You are viewing a single comment's thread. Return to all comments →
n = int(input().strip()) s = str(bin(n)) count = 0 max_1s = 0 for i in range(len(s)): if s[i]=='1': count+=1 if max_1s < count: max_1s = count else: count=0 print(max_1s)
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 →