From 3ccb86e948ba6ac797476ed3c4caad79395f2a3f Mon Sep 17 00:00:00 2001 From: Hunky Jimpjorps Date: Thu, 1 Dec 2022 08:59:41 -0500 Subject: day 1 complete --- 2022/day-01/day-01.rkt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to '2022/day-01/day-01.rkt') 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 +)) -- cgit v1.2.3