Skip to content

Instantly share code, notes, and snippets.

@RyanJJunor
Created December 12, 2020 02:08
Show Gist options
  • Save RyanJJunor/aebd4e671c873e88269a654b6619b1fb to your computer and use it in GitHub Desktop.
Save RyanJJunor/aebd4e671c873e88269a654b6619b1fb to your computer and use it in GitHub Desktop.
AOC Day 10 Part 2
def find_number_of_permutations(tree):
adapters = {}
for i in tree:
for j in tree[i]:
if j not in adapters.keys():
if i in adapters.keys():
adapters[j] = adapters[i]
else: adapters[j] = 1
else:
adapters[j] = adapters[j] + (adapters[i])
return adapters[max(adapters)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment