mirror of
https://github.com/fredrikr79/advent_of_code.git
synced 2026-07-04 18:25:21 +02:00
2025/2/janet: attempt
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
(def example-input `11-22,95-115,998-1012,1188511880-1188511890,222220-222224,1698522-1698528,446443-446449,38593856-38593862,565653-565659,824824821-824824827,2121212118-2121212124`)
|
||||
|
||||
(defn mapi "immutable map" [f xs] (slice (map f xs)))
|
||||
|
||||
(defn parse-input [input]
|
||||
(mapi |(mapi parse (string/split "-" $))
|
||||
(string/split "," input)))
|
||||
|
||||
|
||||
(defn solve/1 [data]
|
||||
(map (fn [[l r]]
|
||||
(range l r))
|
||||
data))
|
||||
|
||||
(pp (solve/1 (parse-input example-input)))
|
||||
Reference in New Issue
Block a user