comefrom: <doocs>2399.Check Distances Between Same Letters_1.py
code: def checkDistances( s: str, distance: List[int]) -> bool:
      d = [0] * 26
      for i, c in enumerate(s):
          j = ord(c) - ord("a")
          if d[j] and i - d[j] != distance[j]:
              return False
          d[j] = i + 1
      return True
masked: def sample_funcname ( var_0 : str , var_1 : List [ int ] ) -> bool :
      var_2 = [ 0 ] * 26
      for var_3 , var_4 in enumerate ( var_0 ) :
          var_5 = ord ( var_4 ) - ord ( "a" )
          if var_2 [ var_5 ] and var_3 - var_2 [ var_5 ] != var_1 [ var_5 ] :
              return False
          var_2 [ var_5 ] = var_3 + 1
      return True
  