<qiyuangong>044_Wildcard_Matching_2.py
def isMatch( s, p):
    s_index, p_index = 0, 0
    star, s_star = -1, 0
    s_len, p_len = len(s), len(p)
    while s_index < s_len:
        if p_index < p_len and (s[s_index] == p[p_index] or p[p_index] == '?'):
            s_index += 1
            p_index += 1
        elif p_index < p_len and p[p_index] == '*':
            star = p_index
            s_star = s_index
            p_index += 1
        elif star != -1:
            p_index = star + 1
            s_star += 1
            s_index = s_star
        else:
            return False
    while p_index < p_len and p[p_index] == '*':
        p_index += 1
    return p_index == p_len
def sample_funcname ( var_0 , var_1 ) :
    var_3 , var_4 = 0 , 0
    var_6 , var_7 = - 1 , 0
    var_9 , var_10 = len ( var_0 ) , len ( var_1 )
    while var_3 < var_9 :
        if var_4 < var_10 and ( var_0 [ var_3 ] == var_1 [ var_4 ] or var_1 [ var_4 ] == '?' ) :
            var_3 += 1
            var_4 += 1
        elif var_4 < var_10 and var_1 [ var_4 ] == '*' :
            var_6 = var_4
            var_7 = var_3
            var_4 += 1
        elif var_6 != - 1 :
            var_4 = var_6 + 1
            var_7 += 1
            var_3 = var_7
        else :
            return False
    while var_4 < var_10 and var_1 [ var_4 ] == '*' :
        var_4 += 1
    return var_4 == var_10
