|
|
@ -5,25 +5,11 @@
|
|
|
|
; the previous number, and the next number.
|
|
|
|
; the previous number, and the next number.
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
(loop [inc-count 0
|
|
|
|
(let [input (->> (slurp "./in")
|
|
|
|
buff (repeat 4 (Integer/parseInt (read-line)))
|
|
|
|
clojure.string/split-lines
|
|
|
|
]
|
|
|
|
(mapv read-string))]
|
|
|
|
(let [next (read-line)
|
|
|
|
(println
|
|
|
|
new-count (if (> (last buff) (first buff))
|
|
|
|
(count
|
|
|
|
(inc inc-count)
|
|
|
|
(filter #(< (get input %) (get input (+ % 3)))
|
|
|
|
inc-count
|
|
|
|
(range 0 (- (count input) 3))))))
|
|
|
|
)
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
(if (empty? next)
|
|
|
|
|
|
|
|
(println new-count)
|
|
|
|
|
|
|
|
(recur
|
|
|
|
|
|
|
|
new-count
|
|
|
|
|
|
|
|
(concat
|
|
|
|
|
|
|
|
(rest buff)
|
|
|
|
|
|
|
|
[(Integer/parseInt next)]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|