(nsballpointcarrot.aoc(:require[clojure.string:asst]))(defnfuel-cost[value](-(Math/floor(/value3))2))(defnadj-fuel-cost[value](let[fuel(fuel-costvalue)](if(pos?fuel)fuel0)))(defnp2019-01"Calculate Fuel requirements"[input](apply+(map#(fuel-cost(Integer/parseInt%))(st/split-linesinput))))(defnrecursive-fuel-cost[value](loop[remainsvaluetotal0](if(=remains0)total(let[fuel(adj-fuel-costremains)](recurfuel(+totalfuel))))))(defnp2019-01-part2"Calculate fuel requirements, including weight of fuel"[input](apply+(map#(recursive-fuel-cost(Integer/parseInt%))(st/split-linesinput))))
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.
Solution in Clojure: