19
Nazar Stepan
Last seen 10 months ago
Member for 4 years, 3 months, 11 days
Difficulty Normal
Very good solution! You can also do this: return elements == [elements[0]] * len(elements)
More
Very long code!
You can solve this in one string:
return elements == [elements[0]] * len(elements)
More
In this solution the program takes last weight in array and puts it on left or on right hands.
If there are no weights in array then the program finds a difference between weights on the hands. Finally the program return the minimum difference.
More
Good idea!
But you can do this in one string:
return elements == [elements[0] * len(elements)
More