solulubeta
Sign in
Recursion & Memo / DP patterns for coding tests
04.14 · Problem

Longest Increasing Subsequence

Medium Index and previous pick LC 300 Pro

Return the length of the longest strictly increasing subsequence of nums. A subsequence keeps the order but may skip elements.

Examples

Example 1

Input:  nums = [10, 9, 2, 5, 3, 7, 101, 18]
Output: 4

For example [2, 3, 7, 101].

solulu Pro

Continue this problem with Pro

Inside: step-by-step hints · 12 hidden tests · reference solutions · code editor.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 40 of 44 · updated 2026-10-13