O50

Longest Increasing Subsequence

Mid / Senior Engineer
Target Time: 25 - 35 Minutes
Type: NUMERIC

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]) -> int

Input & Output Contract

Output Rule:LIS uzunluğu (tam sayı).

System Constraints

1 <= sayilar.length <= 2500
-10^4 <= sayilar[i] <= 10^4

Example Execution Walkthrough

sayilar = [10, 9, 2, 5, 3, 7, 101, 18] -> [2, 3, 7, 101] -> uzunluk: 4

Example Test Scenarios (3)

Example 1
Input:[[10,9,2,5,3,7,101,18]]
Expected Output:4
Example 2: [0, 1, 2, 3]
Input:[[0,1,0,3,2,3]]
Expected Output:4
Example 3: Eşitler (Kesin Artan)
Input:[[7,7,7,7]]
Expected Output:1
Loading Python Editor...
Input Parameters
[
  [
    10,
    9,
    2,
    5,
    3,
    7,
    101,
    18
  ]
]
Expected Output
4