-
-
Save mmower/7529c04e8836fe88b4d8 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
(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