The Levenshtein Distance is a deceptively simple algorithm - by looping over two strings, it can provide the "distance" (the number of differences)...
For further actions, you may consider blocking this person and/or reporting abuse
I will be disappointed if your first efficiency fix isn't reduction of the matrix to current row and row above. None of the rows above these two matter at any given time. Great post, thanks! I now really want to play with this using long strings with whole words added in the middle.
I don't want to spoil anything but... yep, that is the first major memory optimization.
With your specific example though, I think you will like one or two of the other performance improvements more. 🙂
I did once to find out some keyword mistakes in some documents and correct those words automatically. It was pretty cool haha