O50
Longest Increasing Subsequence
Problem Statement & Objective
Given an integer array nums, return the length of the longest strictly increasing subsequence.
Function Signature (Python)
length_of_lis(nums: list[int]) -> intInput & Output Contract
Output Rule:LIS uzunluğu (tam sayı).
System Constraints
1 <= sayilar.length <= 2500
-10^4 <= sayilar[i] <= 10^4Example Execution Walkthrough
sayilar = [10, 9, 2, 5, 3, 7, 101, 18] -> [2, 3, 7, 101] -> uzunluk: 4Example Test Scenarios (3)
Example 1
Input:
[[10,9,2,5,3,7,101,18]]Expected Output:
4Example 2: [0, 1, 2, 3]
Input:
[[0,1,0,3,2,3]]Expected Output:
4Example 3: Eşitler (Kesin Artan)
Input:
[[7,7,7,7]]Expected Output:
1