<s> def levenshtein ( x , y ) : <EOL> """<STR_LIT>""" <EOL> n = len ( x ) <EOL> m = len ( y ) <EOL> A = [ [ i + j for j in range ( m + <NUM_LIT:1> ) ] for i in range ( n + <NUM_LIT:1> ) ] <EOL> for i in range ( n ) : <EOL> for j in range ( m ) : <EOL> A [ i + <NUM_LIT:1> ] [ j + <NUM_LIT:1> ] = min ( A [ i ] [ j + <NUM_LIT:1> ] + <NUM_LIT:1> , <EOL> A [ i + <NUM_LIT:1> ] [ j ] + <NUM_LIT:1> , <EOL> A [ i ] [ j ] + int ( x [ i ] != y [ j ] ) ) <EOL> return A [ n ] [ m ] </s>
