Here's my cleaned up Python solution!
masses = map(int, open('data.txt', 'r').readlines())
# part 1
return mass // 3 - 2
print(sum([calc_fuel(m) for m in masses]))
# part 2
total, fuel = 0, calc_fuel(mass)
while fuel > 0:
total += fuel
fuel = calc_fuel(fuel)
print(sum([calc_additional_fuel(m) for m in masses]))
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.