Skip to content

Instantly share code, notes, and snippets.

@sarcilav
Created October 8, 2015 02:04
Show Gist options
  • Save sarcilav/1eb96fdc5a5c98514492 to your computer and use it in GitHub Desktop.
Save sarcilav/1eb96fdc5a5c98514492 to your computer and use it in GitHub Desktop.
(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