mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 09:23:17 -09:00
golf
This commit is contained in:
parent
e1650bd8f6
commit
8ee2a7d72c
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user