|
|
|
@ -44,12 +44,12 @@ |
|
|
|
|
|
|
|
|
|
(define (sum numbers) (reduce numbers + 0)) |
|
|
|
|
|
|
|
|
|
(define (is-numeric-char char) (if (char-numeric? char) #t #f)) |
|
|
|
|
|
|
|
|
|
(define (solve-line line) |
|
|
|
|
( |
|
|
|
|
(lambda (first-last-result) (string->number (list->string first-last-result))) |
|
|
|
|
(first-last |
|
|
|
|
(string->list line) |
|
|
|
|
(lambda (char) (if (char-numeric? char) #t #f))))) |
|
|
|
|
(first-last (string->list line) is-numeric-char))) |
|
|
|
|
|
|
|
|
|
(define (solve-all lines) |
|
|
|
|
(sum (map lines solve-line))) |
|
|
|
|