diff options
Diffstat (limited to '2022/day-01/day-01.rkt')
-rw-r--r-- | 2022/day-01/day-01.rkt | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/2022/day-01/day-01.rkt b/2022/day-01/day-01.rkt index 2d01605..5215014 100644 --- a/2022/day-01/day-01.rkt +++ b/2022/day-01/day-01.rkt @@ -6,15 +6,15 @@ (define calorie-data (fetch-aoc-input (find-session) 2022 1)) ;; part 1 -(~> calorie-data - (string-split "\n\n") - (map (λ~> string-split (map string->number _) (apply + _)) _) - (apply max _)) +(~>> calorie-data + (string-split _ "\n\n") + (map (λ~>> string-split (map string->number) (apply +))) + (apply max)) ;; part 2 -(~> calorie-data - (string-split "\n\n") - (map (λ~> string-split (map string->number _) (apply + _)) _) - (sort _ >) - (take 3) - (apply + _)) +(~>> calorie-data + (string-split _ "\n\n") + (map (λ~>> string-split (map string->number) (apply +))) + (sort _ >) + (take _ 3) + (apply +)) |