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.
OK, I used a stack to solve the question, but this is much better since it requires only O(1) of extra space! Kudos!
This comment is hidden because it contains spoiler information about the solution
Greate variable naming! I was able to understand the code easily!
This is just a mindblower...
And also an
O(n)
solution unlike the highest rated one, which isO(n log n)
Wanted to mark it as
clever
but the readability of the code won me over so marked it asBest Practices
.misionEnd
< = Good naming convention!This is the most clever answer I've ever seen...
I see why it throws this exception. Output is sometimes bigger than the int.max. need to change the last charcter to 1 or 0