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 inefficient solution O(n^3)
It's very short and working solution but it looks like an obfuscated code which is very hard to understand so I doubt it's a best practice
Doesn't handle overflow
Most solutions fail if maximum int value is passes as a parameter