You are viewing a single comment's thread. Return to all comments →
Blazing fast solution: O(max_run_length) -> for 1001110001100 loop will just run 3 times:
1001110001100
n=int(input()) r=0 while n: n &= n<<1 r+=1 print(r)
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 →
Blazing fast solution: O(max_run_length) -> for
1001110001100loop will just run 3 times: