Data Structures & AlgorithmsVery hardTCS NQT · Accenture

How many windows of length 3 in the string abaaabaa are anagrams of aab (same letters with the same counts)?

  1. A. 6
  2. B. 7
  3. C. 9
  4. D. 5

Correct answer: D. 5

Compare the sorted window with sorted aab; a window must contain exactly two a's and one b.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic