Recursion & DP medium time O(n²) space O(n)
DP — Longest Increasing Subsequence
dp[i] is the length of the longest increasing subsequence that ends at index i. To fill it, look back at every earlier element that is smaller and take the best chain you could extend. The answer is the largest entry.
Every element is a chain of length 1 on its own.
1 / 22
A fixed scene — scrub through it, or open the code.
Practice
Machine twin: /dsa-viz-v2/lis.json — the full deterministic run as structured data.