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.
Your reasoning is more or less okay, the problem is with the test you think to be failing. When I try to run your solution, I see that it fails following test case:
Your solution has a bug which fails for the input above, but it works for the input which you showed and I am not sure what exactly leads you to the conclusion that your solution fails your test, and not the one I found.
You should use
console.log
to print inputs, and probably some other variables too. This way you'll know exactly which test case failed.Your solution fails other test than you showed above.
Your solution has a bug, it is not a kata issue.