Last active
October 8, 2015 13:53
-
-
Save sarcilav/7d1ea75e939104783394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn subseq? [s l] | |
"subseq? returns true if you can transform l by only removing elements into s" | |
(if (empty? l) | |
(empty? s) | |
(if (= (first l) (first s)) | |
(recur (rest s) (rest l)) | |
(recur s (rest l))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment