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.
i thought the same
Thanks for your answers. I was trying various methods for solving this problem. And wondered about recursion.
Fixed.
Jep. Real bummer.
Also, prea(?)ty code doesn't really matter here. If your solution doesn't run in O(n) time, you wouldn't get the test cases with longer input arrays to pass. Just come up with an algorithm that doesn't require more than 1 list traversal. That's the only issue in this Kata. The most obvious brute-force O(n^2) solution doesn't work (otherwise this would be a 7 Kyu Kata at best).
This comment is hidden because it contains spoiler information about the solution
Nice solution!
Your solution looks very similar to @DanielSchuette, so maybe you are the same person or copied his/her's solution. Looks like you've both downvoted this kata, and your solution isn't the most efficient, so that is why this caught my attention.