Skip to content

Files

Latest commit

 

History

History

DP

Problems:

ID Code Problem Name Solution Time Space Type
00 The Knapsack Problem C++ O(N * W) O(N * W) Pick or Leave Pattern
01 300 Longest Increasing Subsequence(LIS) C++ O(N^2 O(N) Pick or Leave Pattern
02 1143 Longest Common Subsequence(LCS) C++ O(N * M) O(N * M) Pick or Leave Pattern
03 416 Partition Equal Subset Sum C++ O(N * Sum) O(N * Sum) Pick or Leave Pattern
04 1691 Maximum Height by Stacking Cuboids C++ O(N^2) O(N^2) Pick or Leave Pattern
05 198 House Robber C++ O(N) O(N) Pick or Leave Pattern
06 309 Best Time to Buy and Sell Stock with Cooldown C++ O(N) O(N) Pick or Leave Pattern
07 72 Edit Distance C++ O(N * M) O(N * M) Enumerate Choices
08 343 Integer Break C++ O(N^2) O(N) Enumerate Choices
09 746 Min Cost Climbing Stairs C++ O(N) O(N) Enumerate Choices
10 279 Perfect Squares C++ O(N * Sqrt(N)) O(N) Enumerate Choices
11 5 Longest Palindromic Substring C++ O(N^2) O(N^2) Range Patterns
12 1105 Filling Bookcase Shelves C++ O(N^2) O(N) Range Patterns
13 1043 Partition Array for Maximum Sum C++ O(N^2) O(N) Range Patterns
14 1312 Minimum Insertion Steps to Make a String Palindrome C++ O(N^2) O(N^2) Range Patterns
15 91 Decode Ways C++ O(N) O(N) Counting
16 10617 Again Palindrome C++ O(N^2) O(N^2) Counting
17 518 Coin Change II C++ O(N^2) O(N^2) Counting
18 377 Combination Sum IV C++ O(N^2) O(N) Counting
19 1155 Number of Dice Rolls With Target Sum C++ O((N^2) * M) O(N * M) Counting
20 823 Binary Trees With Factors C++ O(N^2) O(N) Counting
21 63 Unique Paths II C++ O(N^2) O(N^2) On Grid
22 931 Minimum Falling Path Sum C++ O(N^2) O(N^2) On Grid
23 576 Out of Boundary Paths C++ O(N^3) O(N^3) On Grid
24 221 Maximal Square C++ O(N^2) O(N^2) On Grid
25 174 Dungeon Game C++ O(N^2) O(N^2) On Grid
26 Longest Increasing Subsequence(LIS) C++ Build Output
27 Edit Distance C++ Build Output
28 Brackets for MCM C++ Build Output