comefrom: <doocs>2262.Total Appeal of A String_1.py
code: 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
masked: def sample_funcname ( var_0 : str ) -> int :
      var_2 = var_1 = 0
      var_3 = [ - 1 ] * 26
      for var_4 , var_5 in enumerate ( var_0 ) :
          var_5 = ord ( var_5 ) - ord ( 'a' )
          var_1 += var_4 - var_3 [ var_5 ]
          var_2 += var_1
          var_3 [ var_5 ] = var_4
      return var_2
  