Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
nice but -1 for best practice
It's marked as invalid now, surely it passed some time ago when tests were less exhaustive.
See the post above, it explains how it can (and does) fail.
Well, I copy pasted the code and tried it for 25, 25, 50, 100 where it should return "YES" since for 50 we are returning 25 and for 100 we are returning 50 + 25.
But this code return NO, becuase the iterations are as following:
ticket | given | sum
25 | 0 | 25
25 | 0 | 50
50 | 25 | 50
100 | 75 | 0 (sum < given) = NO
This comment is hidden because it contains spoiler information about the solution