Back to course home
0% completed
Solution: Matchsticks to Square
Problem Statement
You are given an integer array matchsticks
, where matchsticks[i]
represents the length of the i<sup>th</sup> matchstick. You need to make one square
by using these all matchsticks. You are not allowed
to break
any matchstick, but you can link them together, and you can use each matchstick only once.
Return true
, if you make one square using all given matchsticks. Otherwise, return false
.
Examples
- Example 1:
- Input:
[5,5,5,5]
- Expected Output:
true
- Input:
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible