code: def anagram_indices(s, word):
      n = len(s)
      w = len(word)
      res = []
  
      if n < w:
          return res
  
      counter = LettersCounter()
  
      # add all letters from the original word
      for letter in word:
          counter.add_letter(letter)
  
      # remove first w letters from s string
      for i in range(w):
          counter.remove_letter(s[i])
  
      if counter.is_empty():
          res.append(0)
  
      for i in range(w, n):
          # continue with the same logic, add letters from front and remove from the current index
          counter.add_letter(s[i - w])
          counter.remove_letter(s[i])
  
          if counter.is_empty():
              # if there are 0 elements into dictionary, then the word is anagram
              res.append(i - w + 1)
  
      return res
  
file_path: coding-problems/Hashing DS/anagram_indices.py
label_desc: Use image node_id 1 for calling a global function with example usage: anagram_indices(s, word) and returns: res, res