Skip to content

Instantly share code, notes, and snippets.

@pawlos
Created December 17, 2017 14:15
Show Gist options
  • Save pawlos/321e0657fbcc9808be0a12732cc1a2c0 to your computer and use it in GitHub Desktop.
Save pawlos/321e0657fbcc9808be0a12732cc1a2c0 to your computer and use it in GitHub Desktop.
Solution to Day 17: Spinlock - Part 1
#aoc_d17.py
spin = 371
solution = []
solution.append(0)
index = 0
for i in range(1,2018):
index += spin
index %= len(solution)
solution[index+1:index+1] = [i]
index += 1
print solution[solution.index(2017)+1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment