209. Longest Increasing Subsequence

MediumDynamic Programming

Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is derived from the array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of [0,3,1,6,2,2,7].

Examples

Input: [3,5,6,2,5,4,19,5,6,7,12]

Output: 6

Explanation: Public test case for Longest Increasing Subsequence

Constraints

  • 1 <= nums.length <= 2500
  • -10^4 <= nums[i] <= 10^4
Loading...

Run checks all cases above. Submit evaluates all test cases.