<qiyuangong>438_Find_All_Anagrams_in_a_String_2.py
def findAnagrams( s, p):
    if len(s) < len(p):
        return []
    res = []
    p_len = len(p)
    bit_map = []
    for _ in range(26):
        bit_map.append(0)
    for c in p:
        bit_map[ord(c) - ord('a')] += 1
    s_p = str(bit_map)
    for i in range(26):
        bit_map[i] = 0
    for i in range(p_len - 1):
        bit_map[ord(s[i]) - ord('a')] += 1
    for i in range(p_len - 1, len(s)):
        bit_map[ord(s[i]) - ord('a')] += 1
        if i - p_len >= 0:
            bit_map[ord(s[i - p_len]) - ord('a')] -= 1
        if str(bit_map) == s_p:
            res.append(i - p_len + 1)
    return res
def sample_funcname ( var_0 , var_1 ) :
    if len ( var_0 ) < len ( var_1 ) :
        return [ ]
    var_3 = [ ]
    var_4 = len ( var_1 )
    var_5 = [ ]
    for var_8 in range ( 26 ) :
        var_5.append ( 0 )
    for var_11 in var_1 :
        var_5 [ ord ( var_11 ) - ord ( 'a' ) ] += 1
    var_16 = str ( var_5 )
    for var_17 in range ( 26 ) :
        var_5 [ var_17 ] = 0
    for var_17 in range ( var_4 - 1 ) :
        var_5 [ ord ( var_0 [ var_17 ] ) - ord ( 'a' ) ] += 1
    for var_17 in range ( var_4 - 1 , len ( var_0 ) ) :
        var_5 [ ord ( var_0 [ var_17 ] ) - ord ( 'a' ) ] += 1
        if var_17 - var_4 >= 0 :
            var_5 [ ord ( var_0 [ var_17 - var_4 ] ) - ord ( 'a' ) ] -= 1
        if str ( var_5 ) == var_16 :
            var_3.append ( var_17 - var_4 + 1 )
    return var_3
