Loading...
Given an integer array nums, return the length of the longest strictly increasing subsequence.
A subsequence is obtained from the array by deleting zero or more elements without changing the order of the remaining elements. Strictly increasing means every element of the subsequence is greater than the one before it; equal values do not qualify.
Input: nums = [10,9,2,5,3,7,101,18]
Output: 4
Explanation: One longest strictly increasing subsequence is [2,3,7,101].
Input: nums = [0,1,0,3,2,3]
Output: 4
Explanation: [0,1,2,3] is strictly increasing.
Input: nums = [7,7,7,7,7,7,7]
Output: 1
Explanation: Equal values cannot extend a strictly increasing subsequence.
nums.length ≤1000nums[i] ≤104Click "Run" to test with sample cases or "Submit" to run all tests.