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.
Assumes all numbers are in range, returns error for if not.
Nice Kata. Love those inspirers!
As stated in prior comment, the description suggests that only natural numbers will be passed in as arguments. Test cases show otherwise, which is confusing. It would be best to establish input expectations in the description.
This comment is hidden because it contains spoiler information about the solution
Even when coming up with a solution that applies the same logic, it is amazing how one can overcomplicate code! This one is a nice, simple solution. Very intuitive.
@Ulin, very helpful explanation!
Wow, this is one of those where just when you feel you solved it you find out you were not even close, mostly due to a misunderstanding of the mechanics that yield the next bigger number. Check inputs against expected output carefully! and add your own tests with large numbers. Great kata to challenge yourself with!
Nice to be forced to come up with an alternate way of solving this type of problem.