diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2022-11-30 19:55:31 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2022-11-30 19:55:31 -0500 |
commit | 8d43e37df99f280377bed90284d6ac2428334804 (patch) | |
tree | 3a5042c9af29da52b4bac38fd78b3ccde77a1dbc /day10/part1.clj | |
parent | 66ed0b9d27850dc653abc8baa75884f3de311bfa (diff) |
move 2021 days to folder; update README
Diffstat (limited to 'day10/part1.clj')
-rw-r--r-- | day10/part1.clj | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/day10/part1.clj b/day10/part1.clj deleted file mode 100644 index 60ed1e6..0000000 --- a/day10/part1.clj +++ /dev/null @@ -1,22 +0,0 @@ -(def to-closing {\{ \} \( \) \[ \] \< \>}) -(def to-score {\) 3 \] 57 \} 1197 \> 25137}) - -(defn check-line [input] - (loop [in input open '()] - (when-let [c (first in)] - (if (some->> (#{\} \) \] \>} c) (not= (first open))) - c - (recur - (rest in) - (if-let [op (to-closing c)] - (conj open op) - (rest open) - )))))) - -(->> (slurp "./in") - (clojure.string/split-lines) - (map (comp to-score check-line vec)) - (filter some?) - (apply +) - (println)) - |