Skip to content

Instantly share code, notes, and snippets.

@mjrosenb
Created December 15, 2020 17:29
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 mjrosenb/f8dc6d29162dca25e59d2a0226cc7767 to your computer and use it in GitHub Desktop.
Save mjrosenb/f8dc6d29162dca25e59d2a0226cc7767 to your computer and use it in GitHub Desktop.
starters = [0,3,6]
lastPos = {}
last = None
i = 0
for n in starters:
if last is not None:
lastPos[last] = i
i+=1
last = n
while i < 30000000:
newLast = i-lastPos.get(last, i)
lastPos[last] = i
i += 1
last = newLast
print('----')
print(last)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment