aboutsummaryrefslogtreecommitdiffstats
path: root/day4/part2.clj
blob: d5929d6992db7e27d67f8669b571ac7efa38c909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
(->> (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)