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.
This problem should not include the case where there are 0 contestants (n=0). Half of the test cases actually test this, and the test case expects that the answer be 0 even though this is wrong and the description doesn't say how to handle this case. I say it is wrong because there is no numerical way to answer "how big is the smallest team when there are 0 teams?" If there are no teams, obviously there is no size to answer with. If questions on Hackerrank are going to be judged in this nitpicky way that doesn't help us learn algorithms, there should at least be some real life lesson in it. So add a line "if n = 0, print 0" then the lesson can be to follow directions :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Team Formation
You are viewing a single comment's thread. Return to all comments →
This problem should not include the case where there are 0 contestants (n=0). Half of the test cases actually test this, and the test case expects that the answer be 0 even though this is wrong and the description doesn't say how to handle this case. I say it is wrong because there is no numerical way to answer "how big is the smallest team when there are 0 teams?" If there are no teams, obviously there is no size to answer with. If questions on Hackerrank are going to be judged in this nitpicky way that doesn't help us learn algorithms, there should at least be some real life lesson in it. So add a line "if n = 0, print 0" then the lesson can be to follow directions :)