~xenrox/aoc2019

884ebf43521807a31eb79264b6bd9dd586636fbc — Thorben Günther 4 years ago 899f0b2
Second part of 1. exercise
1 files changed, 6 insertions(+), 1 deletions(-)

M 1/main.go
M 1/main.go => 1/main.go +6 -1
@@ 7,7 7,12 @@ import (
)

func calcFuel(mass int) int {
	return mass/3 - 2
	fuel := mass/3 - 2
	if fuel < 0 {
		return 0
	} else {
		return fuel + calcFuel(fuel)
	}
}

func totalFuel(input string) int {