diff options
author | Marvin Borner | 2021-12-02 16:11:20 +0100 |
---|---|---|
committer | Marvin Borner | 2021-12-02 16:11:20 +0100 |
commit | f504d00a116a5f8ee090188a98ad54f894a9732b (patch) | |
tree | d5baba513cc9b6efae4b81bf5da9fdcc581df1b2 /2021/01/solve.rkt | |
parent | b0fce9d8e9dcbb508a6a5c1e953882a97be1fb34 (diff) |
rakete
Diffstat (limited to '2021/01/solve.rkt')
-rw-r--r-- | 2021/01/solve.rkt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/2021/01/solve.rkt b/2021/01/solve.rkt new file mode 100644 index 0000000..4f1401d --- /dev/null +++ b/2021/01/solve.rkt @@ -0,0 +1,12 @@ +#lang racket + +(define LINES (map string->number (file->lines "input"))) + +(define (solve offset) + (for/sum ([x (in-list LINES)] + [y (in-list (drop LINES offset))] + #:when (< x y)) + 1)) + +(solve 1) +(solve 3) |