def minReplacements(original, palindrome, m, n):
    # base case:  we're finished processing either string so we're done
    if (m == 0):  # done processing original string
        return n  # return the number of characters left in palindrome
    if (n == 0):  # done processing palindrome
        return m  # return the number of characters left in the original string

    # The characters in the string match so find out how many edits are
    # required for the remaining characters in the strings.
    if (original[m] == palindrome[n]):
        return minReplacements(origininal, palindrome, m-1, n-1)

    # Recurse on editing a character in the original string
    # with a character in the palindrome string
    return 1 + min(minReplacements(origininal, palindrome, m, n-1),   # insert character
                   minReplacements(origininal, palindrome, m-1, n-1), # replace character
                   minReplacements(origininal, palindrome, m-1, n))   # delete character