Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many distinct rotations does the string aabaab have (including itself)?

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

Correct answer: C. 3

aabaab has period 3, so rotations by 0 and 3 coincide and so on; only 3 different rotations remain.

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

Exams that ask this topic