We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Implementation
  4. Organizing Containers of Balls
  5. Discussions

Organizing Containers of Balls

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • Mortafix
    4 years ago+ 4 comments

    My Python 3 solution:

    def organizingContainers(container):
        r = sorted([sum(x) for x in container])
        c = sorted([sum(x) for x in zip(*container)])
        return "Possible" if r == c else "Impossible"
    
    42|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature