Skip to content

Instantly share code, notes, and snippets.

@brockthebear
Created April 27, 2017 20:27
Show Gist options
  • Save brockthebear/eac1adf9a9fcedc38251e0b76ef47bba to your computer and use it in GitHub Desktop.
Save brockthebear/eac1adf9a9fcedc38251e0b76ef47bba to your computer and use it in GitHub Desktop.
#!/bin/python3
import re
n = int(input().strip())
s = "{0:b}".format(n)
out = max(len(a) for a in re.findall(r'1+', s))
print(out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment