Last active
December 3, 2019 16:52
-
-
Save invasionofsmallcubes/8fc4f22ef747d049b7e0456c786cfd86 to your computer and use it in GitHub Desktop.
Advent Of Code - 2019 - DAY 1 - EX 1 #adventOfCode2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; https://adventofcode.com/2019/day/1 | |
(def massDatabase []) ;; get the input in the link | |
(defn roundDown | |
[num] (int (Math/floor num))) | |
(defn fuelRequired | |
[mass] | |
(- (roundDown (/ mass 3)) 2) | |
) | |
(reduce + (map fuelRequired massDatabase)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment