LeetCode 300 Longest Increasing Subsequence - Problem Statement

The problem

Find the length of the longest strictly increasing subsequence in an array.

A subsequence keeps elements in order but can skip elements. It doesn't need to be contiguous.

With nums = [10,9,2,5,3,7,101,18]:

  • Subsequence [2,3,7,101]: strictly increasing, length 44.
  • Subsequence [2,5,7,18]: also length 44.
  • No length-5 increasing subsequence exists.
  • Answer: 44.

With nums = [0,1,0,3,2,3]:

  • Subsequence [0,1,2,3]: length 44.

Constraints: 11 \le nums.length 2500\le 2500.