Organizing Containers of Balls

  • + 0 comments
    def organizingContainers(container):
        container_sizes = [sum(row) for row in container]
        ball_counts = [sum(i) for i in zip(*container)]
        return "Possible" if sorted(container_sizes) == sorted(ball_counts) else "Impossible"
    

    Python