<doocs>0408.Valid Word Abbreviation_1.py
def validWordAbbreviation( word: str, abbr: str) -> bool:
    i = j = 0
    m, n = len(word), len(abbr)
    while i < m:
        if j >= n:
            return False
        if word[i] == abbr[j]:
            i, j = i + 1, j + 1
            continue
        k = j
        while k < n and abbr[k].isdigit():
            k += 1
        t = abbr[j:k]
        if not t.isdigit() or t[0] == '0' or int(t) == 0:
            return False
        i += int(t)
        j = k
    return i == m and j == n
def sample_funcname ( var_0 : str , var_2 : str ) -> bool :
    var_6 = var_4 = 0
    var_8 , var_9 = len ( var_0 ) , len ( var_2 )
    while var_6 < var_8 :
        if var_4 >= var_9 :
            return False
        if var_0 [ var_6 ] == var_2 [ var_4 ] :
            var_6 , var_4 = var_6 + 1 , var_4 + 1
            continue
        var_12 = var_4
        while var_12 < var_9 and var_2 [ var_12 ].isdigit ( ) :
            var_12 += 1
        var_14 = var_2 [ var_4 : var_12 ]
        if not var_14.isdigit ( ) or var_14 [ 0 ] == '0' or int ( var_14 ) == 0 :
            return False
        var_6 += int ( var_14 )
        var_4 = var_12
    return var_6 == var_8 and var_4 == var_9
