##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You've learned prefix sums. Now find the longest increasing subsequence and optimize with binary search.
The classic two-string DP that shows up everywhere. Foundation for edit distance, diff tools, and sequence alignment.
LCS plus a third operation. Powers spell checkers and translation scoring. Teaches multiple transitions from the same state.
Shifts from "find the best" to "count all ways." When chars match, you add paths instead of taking max. Classic interview problem.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Covered with full walkthrough in this section.
Construct sequences with min/max LIS given constraints. Tests deep understanding of LIS structure.
Maximize min(LIS, reverse LIS) through rearrangement. Beautiful observation about LIS symmetry.
LIS of array concatenated n times. Elegant reduction to counting distinct elements.
Classify elements by their role in all LIS. Advanced understanding of LIS uniqueness.
XOR of LIS lengths across subarrays. Parity observation makes complex problem simple.
LIS with bounded gaps using segment tree. Advanced data structure optimization of LIS.
LIS where adjacent elements share a prime factor. Combines number theory with LIS.
Find max independent set in bubble sort graph. Reduces to LIS via inversions.
Find longest subsequence of consecutive integers. LIS variant with value tracking.
Partition array into three sorted parts. LIS ideas with multiple segments.
Find cities reachable from all but one. DAG + LIS-style reachability.
Represent number as sum of k distinct remainders. Number theory + construction.
LIS with values - maximize sum of beauties in increasing height subsequence. Segment tree optimization.