Solution to problem 6 part 1 in Python
This commit is contained in:
parent
088cf71aa2
commit
4e8696a16e
@ -68,12 +68,12 @@
|
|||||||
|
|
||||||
# What is the total number of direct and indirect orbits in your map data?
|
# 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
|
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):
|
def count_orbits(universe, node, counter, total_sum):
|
||||||
total_sum += counter
|
total_sum += counter
|
||||||
|
Loading…
Reference in New Issue
Block a user