Matchstick square

Write codeHard28 min

Your task

Given matchstick lengths, determine whether you can use every matchstick exactly once to form the four equal-length sides of a square (you may not break a matchstick). 1 <= len(matchsticks) <= 12, lengths are positive. Return a boolean.

Examples

makesquare(matchsticks: list[int]) -> bool
Example 1
Inputmakesquare([1, 1, 2, 2, 2])
OutputTrue