From 0dc8f77ac83ea7b9e51e6c506dac17c4a656015c Mon Sep 17 00:00:00 2001 From: xenia Date: Wed, 6 Dec 2023 02:21:06 -0500 Subject: [PATCH] thanks tali --- 6.rkt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/6.rkt b/6.rkt index a7afc17..65929a7 100644 --- a/6.rkt +++ b/6.rkt @@ -4,12 +4,10 @@ ;; solution for day 6 -(define *fudge* 1e-10) - (define (do-race time dist) - (match-define (list lower upper) (quadratic-solutions 1 (- time) dist)) - (~> (- (floor (- upper *fudge*)) (ceiling (+ lower *fudge*))) - add1 inexact->exact)) + (match-define (list lower upper) + (quadratic-solutions 1 (- time) dist)) + (inexact->exact (- (ceiling upper) (add1 (floor lower))))) (define (part1 input) (for/product ([time (in-list (first input))]