Data Structures & AlgorithmsHardGATE CS · CAT · MBA placement

Three fair six-faced dice are rolled. How many ordered outcomes (d1, d2, d3) have a total of exactly 10?

  1. A. 6
  2. B. 27
  3. C. 13
  4. D. 21

Correct answer: B. 27

Count with DP over the number of dice: each new die adds any face 1 to 6, so the order of results matters. Counting multisets (combinations with repetition) undercounts the ordered outcomes, which is the usual mistake.

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

Exams that ask this topic