Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(def prefix-of? (fn [candidate sequence] (reduce #(and %1 %2) (map = candidate sequence))))
user=> (prefix-of? [1 2] [1 2 3 4])
true
user=> (prefix-of? [2 2] [1 2 3 4])
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.