Data Structures & AlgorithmsHardCodeforces Div2 C · TCS NQT

How many distinct arrangements of the letters of "aabbcc" have no two adjacent letters equal?

  1. A. 36
  2. B. 26
  3. C. 90
  4. D. 30

Correct answer: D. 30

Count distinct arrangements (repeated letters are indistinguishable), then check the adjacency rule. Counting all 6! orderings ignores the repeats and overcounts, while dividing by 2³ removes repeats without the adjacency rule.

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

Exams that ask this topic