From 57576bd5a416f62a7b22f3f7a6d4678632dfd00f Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Sun, 3 Dec 2023 14:43:52 -0500 Subject: [PATCH] apply concat > mapcat identity --- 2023/src/day03.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2023/src/day03.clj b/2023/src/day03.clj index 15c7c9d..fd66b54 100644 --- a/2023/src/day03.clj +++ b/2023/src/day03.clj @@ -12,7 +12,7 @@ (map-indexed (fn [col-idx char] [[row-idx col-idx] char]) line))) - (mapcat identity) + (apply concat) (into {}))) ;; produces a list of [row-idx col-idx "num"] @@ -22,7 +22,7 @@ (map-indexed (fn [row matches] (map #(vector row (:start %) (:group %)) matches))) - (mapcat identity))) + (apply concat))) (defn coords-to-check [row col num-str] (for [r [(dec row) row (inc row)] @@ -49,7 +49,7 @@ (filter #(= \* (second %))) (map #(vector % num-str))))) (filter seq) - (mapcat identity) + (apply concat) (map (fn [[[coords] num-str]] [coords num-str])))) ;; gears is a set of [star-row-idx star-col-idx]