Skip to content

Instantly share code, notes, and snippets.

@openrijal
Created May 25, 2017 12:16
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 openrijal/fe01b3c64a37b81aa66c37a408c7dd25 to your computer and use it in GitHub Desktop.
Save openrijal/fe01b3c64a37b81aa66c37a408c7dd25 to your computer and use it in GitHub Desktop.
circular deaths probelm
num = 100
people = list(range(1,num+1))
index = 0
while len(people) > 1:
people.pop((index+1) % len(people))
index = 0 if (index >= len(people)-1) else (index+1)
print people[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment