<doocs>1930.Unique Length-3 Palindromic Subsequences_1.py
def countPalindromicSubsequence( s: str) -> int:
    res = 0
    for i in range(26):
        c = chr(ord('a') + i)
        if c in s:
            l, r = s.index(c), s.rindex(c)
            chars = {s[j] for j in range(l + 1, r)}
            res += len(chars)
    return res
def sample_funcname ( var_0 : str ) -> int :
    var_4 = 0
    for var_7 in range ( 26 ) :
        var_11 = chr ( ord ( 'a' ) + var_7 )
        if var_11 in var_0 :
            var_13 , var_15 = var_0.index ( var_11 ) , var_0.rindex ( var_11 )
            var_18 = { var_0 [ var_16 ] for var_16 in range ( var_13 + 1 , var_15 ) }
            var_4 += len ( var_18 )
    return var_4
