You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': n = int(input().strip()) a = list(bin(n)[2:]) c = [-1] d = [] for i in range(len(a)): if a[i] == "0": c.append(i) c.append(len(a)) for i in range(len(c)-1): d.append(c[i+1] - (c[i]+1)) print(max(set(d)))
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 →