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.
Like others said, some code solves this kata in 1 second. So it CAN get optimised.
Your code is too slow for this problem. Large values of
N
(up to$10^{18}$
) are tested and your solution should be able to handle such values.Author's solution passes all tests below 1 second. Are you sure that your code is optimized at all?