def solution(N):
# write your code in Python 3.6
bN = str(format(N, '#b'))[2:]
ret = []
if bN.count('1') <= 1:
return 0
idx = -1
while True:
idx = bN.find('1', idx+1)
next_i = bN.find('1', idx+1)
if next_i == -1:
break
ret.append(next_i - idx -1)
return max(ret)
Score: 100/100
Result-Link