<doocs>0091.Decode Ways_1.py
def numDecodings( s: str) -> int:
    n = len(s)
    a, b, c = 0, 1, 0
    for i in range(1, n + 1):
        c = 0
        if s[i - 1] != '0':
            c += b
        if i > 1 and s[i - 2] != '0' and (int(s[i - 2]) * 10 + int(s[i - 1]) <= 26):
            c += a
        a, b = b, c
    return c
def sample_funcname ( var_0 : str ) -> int :
    var_4 = len ( var_0 )
    var_6 , var_8 , var_9 = 0 , 1 , 0
    for var_11 in range ( 1 , var_4 + 1 ) :
        var_9 = 0
        if var_0 [ var_11 - 1 ] != '0' :
            var_9 += var_8
        if var_11 > 1 and var_0 [ var_11 - 2 ] != '0' and ( int ( var_0 [ var_11 - 2 ] ) * 10 + int ( var_0 [ var_11 - 1 ] ) <= 26 ) :
            var_9 += var_6
        var_6 , var_8 = var_8 , var_9
    return var_9
