<jupyter_start><jupyter_text><jupyter_code>def edit_distance(s1, s2):
    m=len(s1)+1
    n=len(s2)+1

    tbl = {}
    for i in range(m): tbl[i,0]=i
    for j in range(n): tbl[0,j]=j
    for i in range(1, m):
        for j in range(1, n):
            cost = 0 if s1[i-1] == s2[j-1] else 1
            tbl[i,j] = min(tbl[i, j-1]+1, tbl[i-1, j]+1, tbl[i-1, j-1]+cost)

    return tbl[i,j]

print(edit_distance("break", "ready"))<jupyter_output>3
{'fraction_non_alphanumeric': 0.20270270270270271, 'fraction_numerical': 0.0518018018018018, 'mean_word_length': 2.7711864406779663, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '72193', 'license': 'Unlicense', 'n_tokens_mistral': 221, 'n_tokens_neox': 209, 'n_words': 44, 'path': 'Edit_distance.ipynb', 'repo_name': 'hocthucv/bt', 'size': '444'}