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 actually happens IRL. Sometimes I expand
Array.prototype
in a kata ( I missconcatMap
), and then the tests use afor .. in
loop to iterate over someArray
, and I get weird failures.Reminds me to expand prototypes the correct way ( and to bash the kata author for not using a
for .. of
loop :P ).Fire the assistent, know your programming language, and use a real one for rocket science ..
Don't be Jeff. ( Don't be Jim either. )
The creator of the kata figured that input of 0 should return 0... at least that's what I think is happening here. My code worked in tests, but failed on submission until I removed the handling of n == 0. Is a lone zero considered "trailing?" I could not find a definitive answer, so I agree that a single zero should be counted as 1.
This comment is hidden because it contains spoiler information about the solution
I find the description to be too much. You don't need to give all these information, they tend to scare people away and make them think the problem is harder than it really is. Let them do they research by themselves because I personally think this is part of the kata too: research. So please, consider removing all these info and just give some hints to them.
This is the lamest Kata I've ever worked on. If I ever stumble upon such kata I'm leaving codewars. I wasted too many time on this. There's not even a "good" hint (yes, I see that the author tried to give a hint, but it really is not valid as a hint) for where that 'dammit' could come from. Such a waste of time.
Why? :/
Lmaooo! Best. Solution. Ever.