a guest Dec 1st, 2019 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- (defn calculate-fuel
- (- (quot mass 3) 2))
- (defn calculate-total-fuel
- "Solves Pt. 1"
- (reduce + (map calculate-fuel masses)))
- (defn calculate-extra-fuel
- (reduce + (drop 1 (take-while pos? (iterate calculate-fuel mass)))))
- (defn calculate-total-extra-fuel
- "Solves Pt. 2"
- (reduce + (map calculate-extra-fuel masses)))
RAW Paste Data