Here's another way to write it -
(defun casesensitivity ( s )
(vl-list->string
(apply 'append
(mapcar '(lambda ( a b ) (if (= a b) (list a) (list 91 a b 93)))
(vl-string->list (strcase s))
(vl-string->list (strcase s t))
)
)
)
)
As for combinations, maybe something like this -
(defun combinations ( s / foo )
(defun foo ( u l )
(if (cdr u)
(append
(mapcar '(lambda ( x ) (cons (car u) x)) (foo (cdr u) (cdr l)))
(mapcar '(lambda ( x ) (cons (car l) x)) (foo (cdr u) (cdr l)))
)
(list u l)
)
)
(mapcar 'vl-list->string
(foo
(vl-string->list (strcase s))
(vl-string->list (strcase s t))
)
)
)
_$ (length (combinations "floor"))
32