diff options
Diffstat (limited to 'year2021/day8/part1.clj')
-rw-r--r-- | year2021/day8/part1.clj | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/year2021/day8/part1.clj b/year2021/day8/part1.clj new file mode 100644 index 0000000..fe06fdf --- /dev/null +++ b/year2021/day8/part1.clj @@ -0,0 +1,15 @@ +(require '[clojure.string :as str]) + +(->> (str/split-lines (slurp "./in")) + (map + (fn [line] + (as-> line $ + (str/split $ #" ") + (subvec $ 11 15) + (filter #(.contains [2 3 4 7] (count %)) $) + (count $) + ))) + (apply +) + (println) + ) + |