From 8ee2a7d72c8ca2236ede17f67d754f1425921b18 Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Wed, 6 Dec 2023 07:57:26 -0500 Subject: [PATCH] golf --- 2023/src/day06.clj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/2023/src/day06.clj b/2023/src/day06.clj index 8c3117e..f57f8c3 100644 --- a/2023/src/day06.clj +++ b/2023/src/day06.clj @@ -3,7 +3,7 @@ day06 (:require [clojure.string :as string] [core :refer [get-puzzle-input]])) -(def input (->> (get-puzzle-input 6))) +(def input (get-puzzle-input 6)) (defn solve [num-str-lists] (->> (map (partial map #(Long/parseLong %)) num-str-lists) @@ -15,13 +15,11 @@ (reduce *))) ;; part 1 -(->> input - (map (partial re-seq #"\d+")) +(->> (map (partial re-seq #"\d+") input) solve) ;; part 2 -(->> input - (map (partial re-seq #"[\s\d]+")) +(->> (map (partial re-seq #"[\s\d]+") input) (map (partial map #(string/replace % " " ""))) solve)