You are viewing a single comment's thread. Return to all comments →
I like this solution too. It is fast and actually readable. But it is not language-dependant at all. Any normal language has bitwise operations.
The same in python3:
n = int(input()) count = 0 while n: n &= n << 1 count += 1 print(count)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
I like this solution too. It is fast and actually readable. But it is not language-dependant at all. Any normal language has bitwise operations.
The same in python3: