<doocs>1638.Count Substrings That Differ by One Character_1.py
def countSubstrings( s: str, t: str) -> int:
    m, n = len(s), len(t)
    ans = 0
    for i in range(m):
        for j in range(n):
            if s[i] != t[j]:
                l = r = 1
                while i - l >= 0 and j - l >= 0 and s[i - l] == t[j - l]:
                    l += 1
                while i + r < m and j + r < n and s[i + r] == t[j + r]:
                    r += 1
                ans += l * r
    return ans
def sample_funcname ( var_0 : str , var_2 : str ) -> int :
    var_5 , var_6 = len ( var_0 ) , len ( var_2 )
    var_8 = 0
    for var_10 in range ( var_5 ) :
        for var_11 in range ( var_6 ) :
            if var_0 [ var_10 ] != var_2 [ var_11 ] :
                var_14 = var_13 = 1
                while var_10 - var_14 >= 0 and var_11 - var_14 >= 0 and var_0 [ var_10 - var_14 ] == var_2 [ var_11 - var_14 ] :
                    var_14 += 1
                while var_10 + var_13 < var_5 and var_11 + var_13 < var_6 and var_0 [ var_10 + var_13 ] == var_2 [ var_11 + var_13 ] :
                    var_13 += 1
                var_8 += var_14 * var_13
    return var_8
