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_2 : List [ int ] ) -> bool :
      var_8 = [ 0 ] * 26
      for var_10 , var_11 in enumerate ( var_0 ) :
          var_14 = ord ( var_11 ) - ord ( "a" )
          if var_8 [ var_14 ] and var_10 - var_8 [ var_14 ] != var_2 [ var_14 ] :
              return False
          var_8 [ var_14 ] = var_10 + 1
      return True
  