• + 1 comment

    Simple python3 solution for this using itertools groupby:

    print(max([len(list(g)) for k, g in groupby(bin(n))]))