Skip to content

Instantly share code, notes, and snippets.

Last active December 2, 2018 05:45
What would you like to do?
Advent of Code 2018 Day 1
(def input (->> (slurp "input.txt")
(map #(Integer. %))))
(def part-1 (apply + input))
(def part-2 (->> (cycle input)
(reductions + 0)
(reduce (fn [seen? v]
(if (seen? v)
(reduced v)
(conj seen? v)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment