šŸ“Š Dynamic Programming Problems

Master memoization, tabulation, LCS, knapsack variations, and optimization problems

Given coin denominations and a target amount, find minimum coins needed.
Input: coins = [1,2,5], amount = 11 → Output: 3 (5+5+1)

java

Find the length of longest common subsequence of two strings.
Input: "abcde", "ace" → Output: 3 ("ace")

java

Given a string and dictionary, determine if string can be segmented into dictionary words.
Input: s = "leetcode", dict = ["leet","code"] → Output: true

java

Find the length of longest strictly increasing subsequence.
Input: [10,9,2,5,3,7,101,18] → Output: 4 ([2,3,7,101])

java

Find minimum operations (insert, delete, replace) to convert word1 to word2.
Input: "horse", "ros" → Output: 3

java

Given weights and values of items, find maximum value that fits in knapsack capacity.

java

Rob houses along a street without robbing two adjacent houses.
Input: [2,7,9,3,1] → Output: 12 (2+9+1)

java

Dynamic Programming Patterns