Skip to content

Instantly share code, notes, and snippets.

@jaihindhreddy
Last active December 2, 2018 05:45
Embed
What would you like to do?
Advent of Code 2018 Day 1
(def input (->> (slurp "input.txt")
clojure.string/split-lines
(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