Skip to content

Instantly share code, notes, and snippets.

@vimishor
Created December 6, 2021 12:54
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 vimishor/a09d8110a306542be1c0f14f8e44b910 to your computer and use it in GitHub Desktop.
Save vimishor/a09d8110a306542be1c0f14f8e44b910 to your computer and use it in GitHub Desktop.
Temp sample
def pop(initial_state, time):
state_cnt = [initial_state.count(i) for i in range(0, 9)]
for _ in range(0, time):
state_cnt = state_cnt[1:] + state_cnt[:1]
state_cnt[6] += state_cnt[8]
return sum(state_cnt)
def partOne(data):
return pop(data, 80)
def partTwo(data):
return pop(data, 256)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment