Better way to find the minimum value in a hash
1 files changed, 1 insertions(+), 2 deletions(-) M server.rkt
M server.rkt => server.rkt +1 -2
@@ 69,8 69,7 @@ (if (empty? votes) (if (hash-empty? firsts) done (let ([last-place (caar (sort (hash->list firsts) (λ (p1 p2) (< (cadr p1) (cadr p2)))))]) (let ([last-place (car (argmin cadr (hash->list firsts)))]) (res (cdr (hash-ref firsts last-place)) (hash-remove firsts last-place) (cons last-place done))))