<doocs>0567.Permutation in String_1.py
def checkInclusion( s1, s2):
    if len(s1) > len(s2):
        return False
    flag1 = [0] * 26
    flag2 = [0] * 26
    for i, x in enumerate(s1):
        flag1[ord(x) - ord('a')] += 1
    
    for i, x in enumerate(s2):
        flag2[ord(x) - ord('a')] += 1
        if i >= len(s1):
            flag2[ord(s2[i - len(s1)]) - ord('a')] -= 1
        if flag1 == flag2:
            return True
    return False
def sample_funcname ( var_0 , var_1 ) :
    if len ( var_0 ) > len ( var_1 ) :
        return False
    var_6 = [ 0 ] * 26
    var_7 = [ 0 ] * 26
    for var_9 , var_10 in enumerate ( var_0 ) :
        var_6 [ ord ( var_10 ) - ord ( 'a' ) ] += 1
    for var_9 , var_10 in enumerate ( var_1 ) :
        var_7 [ ord ( var_10 ) - ord ( 'a' ) ] += 1
        if var_9 >= len ( var_0 ) :
            var_7 [ ord ( var_1 [ var_9 - len ( var_0 ) ] ) - ord ( 'a' ) ] -= 1
        if var_6 == var_7 :
            return True
    return False
