':type s: str
:type t: str
:rtype: bool'

def isOneEditDistance(self, s, t):

    (m, n) = (len(s), len(t))
    if (m > n):
        return self.isOneEditDistance(t, s)
    if ((n - m) > 1):
        return False
    (i, shift) = (0, (n - m))
    while ((i < m) and (s[i] == t[i])):
        i += 1
    if (shift == 0):
        i += 1
    while ((i < m) and (s[i] == t[(i + shift)])):
        i += 1
    return (i == m)
