diff --git a/1.rkt b/1.rkt index 85d4d90..fe51925 100644 --- a/1.rkt +++ b/1.rkt @@ -8,8 +8,7 @@ (apply max (map #{apply + %} input))) (define (part2 input) - (match-define (list* a b c _) (sort (map #{apply + %} input) >)) - (+ a b c)) + (apply + (~> (map #{apply + %} input) (sort >) (take 3)))) (define (parse fname) (define elves (string-split (file->string fname) "\n\n"))