diff --git a/day07.scm b/day07.scm index 76f3e98..b4199de 100644 --- a/day07.scm +++ b/day07.scm @@ -9,10 +9,8 @@ ; PART 1 (let* ((sorted (sort numbers <)) (median (list-ref sorted (floor/ (length numbers) 2))) - (part1 - (foldl (lambda (x y) (+ x (abs (- y median)))) - 0 - numbers))) + (part1 (foldl (lambda (x y) (+ x (abs (- y median)))) + 0 numbers))) (format #t "part 1: ~A~%" part1)) ; PART 2 @@ -20,8 +18,7 @@ (define (part2- avg) (foldl (lambda (x y) (+ x (triangular (abs (- y avg))))) - 0 - numbers)) + 0 numbers)) (let* ((len (length numbers)) (sum (foldl + 0 numbers))