Skip to content

Instantly share code, notes, and snippets.

@zev
Created September 6, 2011 03:49
Show Gist options
  • Save zev/1196530 to your computer and use it in GitHub Desktop.
Save zev/1196530 to your computer and use it in GitHub Desktop.
programming-praxis remove dup chars
;; solution for part 1 http://programmingpraxis.com/2011/09/02/two-string-exercises/
(defun rdup (str)
(defun rdup_ (str res)
(if (null str)
res
(if (member (car str) res)
(rdup_ (cdr str) res)
(rdup_ (cdr str) (append res (list (car str)))))))
(concat (rdup_ (string-to-list str) '())))
(rdup "aabbccd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment