You are viewing a single comment's thread. Return to all comments →
Python 3 code
import math import os import random import re import sys
if name == 'main': n = int(input().strip()) binary = bin(n)[2:] print(len(max(binary.split("0"))))
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 →
Python 3 code
import math import os import random import re import sys
if name == 'main': n = int(input().strip()) binary = bin(n)[2:] print(len(max(binary.split("0"))))