Skip to content

Instantly share code, notes, and snippets.

@amcnamara
Created September 4, 2011 23:37
Show Gist options
  • Select an option

  • Save amcnamara/1193721 to your computer and use it in GitHub Desktop.

Select an option

Save amcnamara/1193721 to your computer and use it in GitHub Desktop.
Test for single character difference (sub, del, ins) between two strings.
#(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