You are viewing a single comment's thread. Return to all comments →
binary=list(map(int,bin(int(input())).replace('b',''))) print(binary) result = 0 maximum = 0 for i in binary: if i==1: result += 1 if result > maximum: maximum = result else: result = 0 print(maximum)
Seems like cookies are disabled on this browser, please enable them to open this website
Consecutive 1's in Binary Numbers
You are viewing a single comment's thread. Return to all comments →