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.
Very cool! Unless I am missing something, this solution runs in constant time O(1) as the common solution (even I wrote it with a loop) using a loop is linear O(n) time. Please, someone correct me if I am wrong.
It's a bug in the test cases that still isn't fixed.
EDIT: NOT A BUG. I MISREAD THE INSTRUCTIONS.
Getting the false negative failing test case. I debugged and believe the number passed in is 159 which sums to 15. But test case is expecting 6.
EDIT: In Python
EDIT2: NOT A BUG. I MISREAD THE INSTRUCTIONS.