You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': n = int(input().strip()) binary = f"{n:b}" pattern = r'1+' cons_occ = [len(i) for i in re.findall(pattern, binary)] print(max(cons_occ))
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 →