You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
428 B
Clojure

(->> (slurp "input")
(#(clojure.string/split % #"[^0-9]"))
(map read-string)
(partition 4)
(map
#(or (and (>= (first %) (nth % 2)) (<= (first %) (nth % 3)))
(and (>= (second %) (nth % 2)) (<= (second %) (nth % 3)))
(and (>= (nth % 2) (first %)) (<= (nth % 2) (second %)))
(and (>= (nth % 3) (first %)) (<= (nth % 3) (second %)))))
(filter true?)
count
println)