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))]