SHARE
TWEET

Untitled

a guest Dec 1st, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn required-fuel [mass]
  2.   (- (int (Math/floor (/ mass 3))) 2))
  3.  
  4. (with-open [r (clojure.java.io/reader "/tmp/input")]
  5.   (->> (line-seq r)
  6.        (filter not-empty)
  7.        (map #(Integer/valueOf %))
  8.        (map required-fuel)
  9.        (reduce + 0))) ;; => 3452245
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top