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!
This comment is hidden because it contains spoiler information about the solution
Neeeeat!
Interesting way of thinking about it, but your solution makes sense. Clever!
This comment is hidden because it contains spoiler information about the solution
Wasn't specified in the kata description but that's a good edge case to consider, I suppose.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Kudos for including multiple ways to do this. Second one is simplest but the first one is really clever!
Smart!
This is very clever! But two questions: 1) how does this take care of the scenario when you don't have subsequent negative numbers? (i.e. [3, -30, 1, -20 ...so on]), and 2) on the same note, with the c <= 0 conditonal, I see that you are trying to take care of the 0 scenario plus the negative number scenario. But.. when if the current is 0 and the next number is a positive one? Would that mess up the computation since you need to do p[0] += 1, not p[1] += c? Hope I'm making sense here.
Nice! This is easy to read and understand, so that's a plus. A few tips for optimization:
That's mainly it but I do think this is a nice, straightforward solution. Good job!
This comment is hidden because it contains spoiler information about the solution
Clever! Agree with the prev comments, but this was a smart solution nonetheless.