Created
October 8, 2015 02:04
-
-
Save sarcilav/1eb96fdc5a5c98514492 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 preffix [& args] | |
(map first (take-while (partial apply =) (apply map vector args)))) | |
(defn suffix-with-p [s p] | |
(drop (count p) s)) | |
(defn nice-print [col] | |
(println (count col) (apply str col))) | |
(defn *nice-print [& args] | |
(doseq [n args] | |
(nice-print n))) | |
(defn doit [a b] | |
(let [p (preffix a b) | |
a' (suffix-with-p a p) | |
b' (suffix-with-p b p)] | |
(*nice-print p a' b'))) | |
(doit (read-line) (read-line)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment