You are viewing a single comment's thread. Return to all comments →
Python
n = int(input().strip()) temp = 0 res = 0 while n != 0: if n % 2 == 1: temp += 1 elif n % 2 == 0: temp = 0 res = max(temp, res) n = (int)(n / 2) print(res)
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 →
Python