Skip to content

Commit 27f9184

Browse files
committed
day1 completed
1 parent 14ff86a commit 27f9184

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

day1/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ func calculateFuelForModuleWithFuelMass(input int) int {
5151

5252
for {
5353
fuel = calculateFuelForModule(fuel)
54-
neededfuel += fuel
54+
if fuel > 0 {
55+
neededfuel += fuel
56+
}
5557
if fuel < 1 {
5658
break
5759
}

0 commit comments

Comments
 (0)