Given an integer array nums, return the length of the longest strictly increasing subsequence — a subsequence that keeps the original relative order but need not be contiguous.
nums = [10,9,2,5,3,7,101,18]4nums = [0,1,0,3,2,3]4Solve it in the editor. Sign in free to run your Python or JavaScript against test cases, get a verdict, and track your attempts.
Solve on FeatCode →Break a problem into overlapping subproblems along a single dimension — like "the answer up to index i" — solve each one once, and reuse the result instead of recomputing it.
Read the full 1-D Dynamic Programming guide →
Original problem on LeetCode ↗