Matchsticks to Square
Rememberthe story of Little Match Girl? By now, you know exactly what matchsticks thelittle match girl has, please find out a way you can make one square by usingup all those matchsticks. You should not break any stick, but you can link themup, and each matchstick must be used exactly one time.
Yourinput will be several matchsticks the girl has, represented with their sticklength. Your output will either be true or false, to represent whether you cansave this little girl or not.
Example1:
Input:[1,1,2,2,2]
Output:true
<