<doocs>2262.Total Appeal of A String_1.py
def appealSum( s: str) -> int:
    ans = t = 0
    pos = [-1] * 26
    for i, c in enumerate(s):
        c = ord(c) - ord('a')
        t += i - pos[c]
        ans += t
        pos[c] = i
    return ans
def sample_funcname ( var_0 : str ) -> int :
    var_5 = var_3 = 0
    var_8 = [ - 1 ] * 26
    for var_10 , var_11 in enumerate ( var_0 ) :
        var_11 = ord ( var_11 ) - ord ( 'a' )
        var_3 += var_10 - var_8 [ var_11 ]
        var_5 += var_3
        var_8 [ var_11 ] = var_10
    return var_5
