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.
It's not a matter of code length, it's a matter of time complexity, have you tried with
n = 1000000000
?Sample tests work fine with my code, ran it with different options on VSCode with no issues. But when "Attempting", server times out. I'm sure the code can be shortened, but it is correct.