fix utf8
This commit is contained in:
parent
80737d5a6a
commit
fc81c9e6d0
45 changed files with 169 additions and 178 deletions
|
|
@ -9,13 +9,13 @@
|
|||
(define (hash-words words)
|
||||
(for/fold ([ws-hash (hash)]) ([w words])
|
||||
(hash-update ws-hash
|
||||
(list->string (sort (string->list w) < #:key (λ (c) (char->integer c))))
|
||||
(λ (ws) (cons w ws))
|
||||
(λ () '()))))
|
||||
(list->string (sort (string->list w) < #:key (λ (c) (char->integer c))))
|
||||
(λ (ws) (cons w ws))
|
||||
(λ () '()))))
|
||||
|
||||
(define (get-maxes h)
|
||||
(define max-ws (apply max (map length (hash-values h))))
|
||||
(define max-keys (filter (λ (k) (= (length (hash-ref h k)) max-ws)) (hash-keys h)))
|
||||
(map (λ (k) (hash-ref h k)) max-keys))
|
||||
(define max-keys (filter (λ (k) (= (length (hash-ref h k)) max-ws)) (hash-keys h)))
|
||||
(map (λ (k) (hash-ref h k)) max-keys))
|
||||
|
||||
(get-maxes (hash-words (get-lines "http://www.puzzlers.org/pub/wordlists/unixdict.txt")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue