2017
Matthew Butterick 6 years ago
parent 040ffb8a80
commit 196f710363

@ -17,7 +17,7 @@
(define digits (for/list ([c (in-string (number->string num))])
(string->number (string c))))
(define offset (if (eq? offset-sig ') -1 (/ (length digits) 2)))
(for/sum ([first (in-list digits)]
[second (in-list (shift-cycle digits offset))]
#:when (= first second))
first))
(for/sum ([digit (in-list digits)]
[other-digit (in-list (shift-cycle digits offset))]
#:when (= digit other-digit))
digit))