Created
September 4, 2011 23:37
-
-
Save amcnamara/1193721 to your computer and use it in GitHub Desktop.
Test for single character difference (sub, del, ins) between two strings.
This file contains hidden or 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
| #(loop [i % j %2] | |
| (if (not= (first i) (first j)) | |
| (or (= (rest i) (rest j)) (= (rest i) j) (= i (rest j))) | |
| (or (empty? i) (recur (rest i) (rest j))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment