Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (fn [s]
- (letfn [(p [s]
- (if (next s)
- (apply concat
- (for [x s] (map #(cons x %) (p (disj s x)))))
- [s]))
- (l [s t]
- (let [i (count (take-while #(apply = %) (partition 2 (interleave s t))))
- s (subs s i)
- t (subs t i)
- f #(apply str (rest %))
- u (f s)
- v (f t)]
- (or (= u v) (= s v) (= t u))))]
- (boolean (some (fn [c] (every? #(apply l %) (partition 2 1 c))) (p s)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement