(loop for str = "1"
then (format nil "~{~a~}"
(nreverse (reduce (lambda (plist char)
(if (eq char (car plist))
(progn (incf (cadr plist)) plist)
`(,char 1 ,@plist)))
str
:initial-value nil)))
repeat 11
do (print str))
KGxvb3AgZm9yIHN0ciA9ICIxIgogICAgICB0aGVuIChmb3JtYXQgbmlsICJ+e35hfn0iCgkJICAgKG5yZXZlcnNlIChyZWR1Y2UgKGxhbWJkYSAocGxpc3QgY2hhcikKCQkJCQkJICAgICAgIChpZiAoZXEgY2hhciAoY2FyIHBsaXN0KSkKCQkJCQkJCQkgICAocHJvZ24gKGluY2YgKGNhZHIgcGxpc3QpKSBwbGlzdCkKCQkJCQkJCQkgICBgKCxjaGFyIDEgLEBwbGlzdCkpKQoJCQkJCQkgICAgIHN0cgoJCQkJCQkgICAgIDppbml0aWFsLXZhbHVlIG5pbCkpKQogICAgICByZXBlYXQgMTEKICAgICAgZG8gKHByaW50IHN0cikp