medium
Longest Increasing Subsequence
Given an integer array, return the length of the longest strictly increasing subsequence (elements need not be contiguous but must keep their relative order).
Constraints
- 1 ≤ n ≤ 2500
- -10^4 ≤ nums[i] ≤ 10^4
Examples
in: nums = [10,9,2,5,3,7,101,18]
out: 4
2, 3, 7, 101.
Code it yourself
Solve in
Test execution is not yet available for this exercise.Practice journal →Draft saved in this browser.
Hints:
Which approach applies?
Choose an approach to check your pattern recognition, or reveal the discussion when you need help.