#lang racket
(define (programming048 . args)
(foldl (lambda (s-2 s-1)
(string-append s-1
(substring s-2
(foldl (lambda (cnt init)
(if (string-ci=? (substring s-1 (- (string-length s-1) cnt))
(substring s-2 0 cnt))
cnt
init))
0
(range 1 (add1 (apply min (map string-length `(,s-1 ,s-2)))))))))
(car args) (cdr args)))
I2xhbmcgcmFja2V0CgooZGVmaW5lIChwcm9ncmFtbWluZzA0OCAuIGFyZ3MpCiAgKGZvbGRsIChsYW1iZGEgKHMtMiBzLTEpCiAgICAgICAgICAgKHN0cmluZy1hcHBlbmQgcy0xCiAgICAgICAgICAgICAgICAgICAgICAgICAgKHN1YnN0cmluZyBzLTIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb2xkbCAobGFtYmRhIChjbnQgaW5pdCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpZiAoc3RyaW5nLWNpPT8gKHN1YnN0cmluZyBzLTEgKC0gKHN0cmluZy1sZW5ndGggcy0xKSBjbnQpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3Vic3RyaW5nIHMtMiAwIGNudCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY250CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyYW5nZSAxIChhZGQxIChhcHBseSBtaW4gKG1hcCBzdHJpbmctbGVuZ3RoIGAoLHMtMSAscy0yKSkpKSkpKSkpCiAgICAgICAgIChjYXIgYXJncykgKGNkciBhcmdzKSkp