Pattern
2-D DP
Use a two-dimensional table when the state needs two numbers, such as a position in each of two strings, or a row and a column. Each cell depends on a few neighbours. The cost is usually the table size, and you can often keep only one or two rows.
1. Unique Pathsgrid · dynamic programming · combinatoricsMed.2. Longest Common Subsequencestring · dynamic programming · subsequenceMed.3. Best Time to Buy and Sell Stock with Cooldownarray · dynamic programming · state machineMed.4. Coin Change IIarray · dynamic programming · countingMed.5. Target Sumarray · dynamic programming · subset sumMed.6. Interleaving Stringstring · dynamic programming · two stringsMed.7. Edit Distancestring · dynamic programming · edit distanceMed.8. Longest Increasing Path in a Matrixmatrix · dynamic programming · graphHard9. Distinct Subsequencesstring · dynamic programming · countingHard10. Burst Balloonsarray · dynamic programming · intervalHard11. Regular Expression Matchingstring · dynamic programming · pattern matchingHard