Day 1, always good to start nice and easy!
Solution for part two:
defmodule Aoc19.Day1b do @moduledoc false alias Aoc19.Utils.Common alias Aoc19.Utils.Day1, as: Day1Utils def start(input_location) do input_location |> Common.read_numbers() |> Enum.reduce(0, &fuel/2) |> trunc() end def fuel(0, total), do: total def fuel(mass, total) do fuel = mass |> Day1Utils.fuel() |> Kernel.max(0) fuel(fuel, total + fuel) end end
And here is part one
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Day 1, always good to start nice and easy!
Solution for part two:
And here is part one