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.
It uses
null
now. Output is specified for tested inputs. Shall we leave it at that?Added some random cases for ruby
This comment is hidden because it contains spoiler information about the solution
I would agree with you, but I think the purpose of the grasshopper series is to be completable by middle school students.
The test is on 9876543210. You are returning 8976543210 instead of -1.
You need to handle the case of numbers for which no higher number exists.
Your function has to return true or false depending on whether the coordinates are valid or not.
match
doesn't do that. It returnsnull
or an array containing the matches.While the first 13 tests use
Test.expect
which works with falsy and truthy values, the random tests actually check if you returntrue/false
instead of some array ornull
.I can't really say what the 14th test is since it's randomly decided (after 13 fixed tests).
But considering there have been more than 800 correct submissions, I have reason to believe the problem lies in your code.
Could you post your code here?
or I'd rather return undefined in this case, not null