You are viewing a single comment's thread. Return to all comments →
import re def DecToBin(n): binary = [] while n >= 1: n, r = divmod(n, 2) binary.append(str(r)) return ''.join(binary[::-1]) if __name__ == '__main__': n = int(input().strip()) print(len(max(re.findall('(1+)', DecToBin(n)))))
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →