Explanations, pseudocode, an embedded interactive visualization, implementations in JavaScript, Python, Java and Go, complexity and interview variations.
Memoise or tabulate to turn O(2ⁿ) into O(n).
ways(n) = ways(n−1) + ways(n−2).
Best value with capacity W, each item taken at most once.
2-D table over prefixes of both strings.
O(n²) DP or O(n log n) with patience sorting.
Fewest coins (or number of ways) to make an amount.
Best parenthesisation via interval DP.
paths(r, c) = paths(r−1, c) + paths(r, c−1).