Solution to problem 6 part 1 in Python

This commit is contained in:
David Doblas Jiménez 2022-03-08 21:16:30 +01:00
parent 088cf71aa2
commit 4e8696a16e

View File

@ -68,12 +68,12 @@
# What is the total number of direct and indirect orbits in your map data?
with open("files/P6.txt") as f:
orbits = [line for line in f.read().strip().split()]
from collections import defaultdict
with open("files/P6.txt") as f:
orbits = [line for line in f.read().strip().split()]
def count_orbits(universe, node, counter, total_sum):
total_sum += counter