Dodomeki
Sign in

88. Increasing Subsequence

Medium

Given an array numeros, return the length of the longest strictly increasing subsequence. A subsequence preserves the order of elements, but may skip positions.

Example 1
Input: numeros = [10, 9, 2, 5, 3, 7, 101, 18]
Output: 4
Explanation: One possible subsequence is [2, 3, 7, 18].
Example 2
Input: numeros = [0, 1, 0, 3, 2, 3]
Output: 4
Constraints
  • 0 <= numeros.length <= 10^4
  • -10^4 <= numeros[i] <= 10^4
Dynamic programmingBinary search
Caso 1
numeros =
[10,9,2,5,3,7,101,18]
Expected =
4
Caso 2
numeros =
[0,1,0,3,2,3]
Expected =
4

Run checks these 2 cases. Submit runs all 6, including hidden ones.