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.
thanks! i was not knowing this concept.
The time complexity of
n - 1
andn & m
is notO(1)
in Python. Moreover, builtin functions are much faster in Python. That's why the solution from the link is significantly faster than yours on relatively large inputs.ok
Try to run your solution with
n = (1 << 500000) - 1
and this solution with the samen
.But i'm not doing (1 << 65536)... elaborate what you wanna say!
For relatively small numbers there's no difference. If you test it with huge inputs like
(1 << 65536) - 1
, it's super slow compared to others.I think this is the fastest solution
that's right for Python 3 (this solution passes the kata in Python 2)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution