
Building the DP table of your career...

Building the DP table of your career...
Break problems into overlapping subproblems with optimal substructure
You are climbing a staircase with n steps. Each time you can climb either 1 or 2 steps. Count the number of distinct ways to reach the top.
Given an m x n grid, count unique paths from top-left to bottom-right. You can only move right or down.
Given two strings, find the length of their longest common subsequence. A subsequence maintains relative order but not contiguity.
Given n items with weights and values, and a knapsack capacity W, find the maximum value achievable. Each item can be used at most once.
Find the length of the longest strictly increasing subsequence in an array.
Given dimensions of n matrices (dims array of length n+1), find minimum operations to multiply them all. Matrix i has dimensions dims[i-1] x dims[i].
Given array of stock prices, find maximum profit from one buy-sell transaction. You must buy before selling.
Houses form a binary tree. You cannot rob adjacent houses (parent-child). Find maximum money you can rob.
Master the fundamental pattern. Each problem teaches you when and how to apply this technique.