Skip to content

Instantly share code, notes, and snippets.

@sarcilav
Last active October 8, 2015 13:53
Show Gist options
  • Save sarcilav/7d1ea75e939104783394 to your computer and use it in GitHub Desktop.
Save sarcilav/7d1ea75e939104783394 to your computer and use it in GitHub Desktop.
(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