Follow

... and, beautifully recursive solution:
---
RT @JBiserkov
@sfyire (defn one-edit-away? [a b]
(cond (= a b) true
(= (first a) (first b)) (recur (subs a 1) (subs b 1))
:else (= (if (>= (count a) (count b)) (subs a 1) a)
(if (>= (count b) (count a)) (subs b 1) b))))

code golf is amazing, thanks for this
twitter.com/JBiserkov/status/1

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.