You are viewing a single comment's thread. Return to all comments →
Oh god, such beuty solution... i just complicate myself..
from itertools import groupby max_length = 0 groups = groupby(bin(int(input()))) for group in groups: len_num = len(list(group[1])) if group[0]=='1' and len_num > max_length: max_length = len_num print(max_length)
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 →
Oh god, such beuty solution... i just complicate myself..