Data Structures & AlgorithmsHardCAT · GATE CS

Problem: The number of ways to split a line of 6 people into 2 groups of 3 (groups are distinguishable by their first member, so each split is counted once as an unordered pair of groups) is what value?

  1. A. 20
  2. B. 15
  3. C. 10
  4. D. 5

Correct answer: C. 10

Fix person 0; choosing the other 2 members of that group from 5 people gives C(5,2) = 10 unordered splits. C(6,3) = 20 counts each split twice, C(6,2) = 15 uses the wrong group, and 5 picks only one partner.

More Coding Interview Problems questions

Exams that ask this topic