Cool! That's a very compact implementation.
Could the same technique be adapted to give you the longest common
substring?
e.g. (foo "fooba" "baab") => "ba"
Or better yet, the length of the longest common substring and the starting
indices of each common substring of that length,
e.g. (foo "baaboobaa" "baa") => {:length 3, :indices #{0 6}}
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en