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]
|
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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user