Data Structures & AlgorithmsHard

How many subsequences of 1 2 3 4 2 2 (position subsets) of size at least 2 have sum EQUAL to their product?

  1. A. 12
  2. B. 6
  3. C. 8
  4. D. 7

Correct answer: B. 6

Enumerate subsets of size at least two and compare sum with product; subsets with a 1 mostly fail because multiplying by 1 changes nothing. Allowing singletons, using strict or offset comparisons each change the count.

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

Exams that ask this topic