day 1: bikeshed
This commit is contained in:
parent
8b342f6d7b
commit
e2fee2f19a
3
1.rkt
3
1.rkt
|
@ -8,8 +8,7 @@
|
||||||
(apply max (map #{apply + %} input)))
|
(apply max (map #{apply + %} input)))
|
||||||
|
|
||||||
(define (part2 input)
|
(define (part2 input)
|
||||||
(match-define (list* a b c _) (sort (map #{apply + %} input) >))
|
(apply + (~> (map #{apply + %} input) (sort >) (take 3))))
|
||||||
(+ a b c))
|
|
||||||
|
|
||||||
(define (parse fname)
|
(define (parse fname)
|
||||||
(define elves (string-split (file->string fname) "\n\n"))
|
(define elves (string-split (file->string fname) "\n\n"))
|
||||||
|
|
Loading…
Reference in New Issue