Skip to content

Instantly share code, notes, and snippets.

@marksteve
Created September 25, 2015 05:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marksteve/e9917fb357fb328b07f0 to your computer and use it in GitHub Desktop.
Save marksteve/e9917fb357fb328b07f0 to your computer and use it in GitHub Desktop.
def circle(people, i=0):
killer = people[i % len(people)]
i = (i + 1) % len(people)
killed = people.pop(i)
return circle(people, i) if len(people) > 1 else people.pop()
print circle(range(1, 101))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment