This commit is contained in:
Adam Jeniski 2023-12-06 07:57:26 -05:00
parent e1650bd8f6
commit 8ee2a7d72c

View File

@ -3,7 +3,7 @@
day06 (:require [clojure.string :as string] day06 (:require [clojure.string :as string]
[core :refer [get-puzzle-input]])) [core :refer [get-puzzle-input]]))
(def input (->> (get-puzzle-input 6))) (def input (get-puzzle-input 6))
(defn solve [num-str-lists] (defn solve [num-str-lists]
(->> (map (partial map #(Long/parseLong %)) num-str-lists) (->> (map (partial map #(Long/parseLong %)) num-str-lists)
@ -15,13 +15,11 @@
(reduce *))) (reduce *)))
;; part 1 ;; part 1
(->> input (->> (map (partial re-seq #"\d+") input)
(map (partial re-seq #"\d+"))
solve) solve)
;; part 2 ;; part 2
(->> input (->> (map (partial re-seq #"[\s\d]+") input)
(map (partial re-seq #"[\s\d]+"))
(map (partial map #(string/replace % " " ""))) (map (partial map #(string/replace % " " "")))
solve) solve)