GATE Computer ScienceVery hardGATE CSE · UGC NET

In how many ways can a longest strictly increasing subsequence be chosen (counting index sets, not distinct value sequences) from the array [3, 1, 2, 5, 4, 6, 3, 7, 5, 8]?

  1. A. 0
  2. B. 2
  3. C. 4
  4. D. 6

Correct answer: B. 2

The LIS length is 6; DP with counts per ending index (confirmed by brute force) gives 2 index sets.

More Algorithms questions

Exams that ask this topic