You are viewing a single comment's thread. Return to all comments →
python3
n = int(input()) s = str(bin(n)) l = [] ss = 0 for i in s: if i == '1': ss += 1 l.append(ss) elif i == '0': ss = 0 print(max(l))
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 →
python3