diff options
Diffstat (limited to 'aoc2019_gleam')
-rw-r--r-- | aoc2019_gleam/src/aoc_2019/day_1.gleam | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/aoc2019_gleam/src/aoc_2019/day_1.gleam b/aoc2019_gleam/src/aoc_2019/day_1.gleam index 7e23172..8a7fd2d 100644 --- a/aoc2019_gleam/src/aoc_2019/day_1.gleam +++ b/aoc2019_gleam/src/aoc_2019/day_1.gleam @@ -11,13 +11,11 @@ pub fn parse(input: String) -> List(Int) { } pub fn pt_1(input: List(Int)) { - input - |> list.fold(0, fn(total, next) { total + naive_fuel(next) }) + list.fold(input, 0, fn(total, next) { total + naive_fuel(next) }) } pub fn pt_2(input: List(Int)) { - input - |> list.fold(0, fn(total, next) { total + recursive_fuel(next) }) + list.fold(input, 0, fn(total, next) { total + recursive_fuel(next) }) } fn naive_fuel(weight: Int) -> Int { |