Skip to content

Instantly share code, notes, and snippets.

@popey456963
Created November 4, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popey456963/411f407ec0c18503ef41e78ccca0a30e to your computer and use it in GitHub Desktop.
Save popey456963/411f407ec0c18503ef41e78ccca0a30e to your computer and use it in GitHub Desktop.
Flipping Switches
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