You are viewing a single comment's thread. Return to all comments →
My idea consists of verifying if the number of balls of each type is equal to the number of spaces in each box.
Python Code
def organizingContainers(container): total_spaces = sorted(list(map(sum, container))) total_balls = sorted(list(map(sum, zip(*container)))) if total_spaces == total_balls: return 'Possible' else: return 'Impossible'
Seems like cookies are disabled on this browser, please enable them to open this website
Organizing Containers of Balls
You are viewing a single comment's thread. Return to all comments →
My idea consists of verifying if the number of balls of each type is equal to the number of spaces in each box.
Python Code