Created
November 4, 2016 22:31
-
-
Save popey456963/411f407ec0c18503ef41e78ccca0a30e to your computer and use it in GitHub Desktop.
Flipping Switches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i,s='36047399',[0]*10 | |
for j,k in zip(i,i[1:])[::2]: | |
r=sorted([int(j),int(k)]);r[1]+=1 | |
for l in range(*r):s[l]^=1 | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment