News for hackers. Stuff that matters.
Re:The ReadyForZero Programming Challenge by llimllib on Tuesday June 14, 2011 @06:56PM (#2655165)
Why? It's not hard to write a quick and dirty levenshtein function, but when google gets it for me in 1 minute, why do it?

edit: just for fun, as a one-liner:

    def levenshtein(a,b): return sum(x!=y for x,y in zip(a, b))
edit 2: and just to clarify, I know this fails if the lengths of the input strings differ, they were guaranteed to be equal in my code.

There are no comments on this comment yet.