Created
December 12, 2020 02:08
-
-
Save RyanJJunor/aebd4e671c873e88269a654b6619b1fb to your computer and use it in GitHub Desktop.
AOC Day 10 Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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