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.
Organizing Containers of Balls
Organizing Containers of Balls
Sort by
recency
|
616 Discussions
|
Please Login in order to post a comment
This problem sucks. It has no relevance in the really real world and is so poorly stated it is more of a 'can i parse this idiots question' versus solve some algorithm. Damn I hate this site
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-organizing-containers-of-balls-problem-solution.html
c# code, O(nlogn)
Here is my C# solution.
In short, we calculate sizes of containers and count of balls of each type. And then, for each type of balls we try to find a container of appropriate size. If we can do this we succeed, otherwise we fail.