15 lines
365 B
Racket
15 lines
365 B
Racket
#lang racket
|
|
|
|
(with-input-from-file "../input/01"
|
|
(lambda ()
|
|
(for/fold ([cnt 0]
|
|
[last null]
|
|
#:result cnt)
|
|
([line (in-lines)])
|
|
(let ([num (string->number line)])
|
|
(values (cond [(null? last) cnt]
|
|
[(> num last) (+ cnt 1)]
|
|
[else cnt])
|
|
num)))))
|
|
|