Kadane’s algorithm

Read more →

Word wrap

Read more →

Edit distance

Read more →

Word break

Read more →

Count all palindromic subsequence in a given string

Read more →

Coin change

Read more →

Knapsack

Read more →

Binomial coefficient

Read more →

Permutation coefficient

Read more →

Nth catalan number

Read more →

Matrix chain multiplication

Read more →

Subset sum aka Partitions

Read more →

Friends pairing

Read more →

Gold mine

Read more →

Assembly line scheduling

Read more →

Painting the fence

Read more →

Maximize the cut segments

https://practice.geeksforgeeks.org/problems/cutted-segments/0 class Solution { int dp[10005]; int solve(int x, int a, int b, int c) { if (dp[x] != -1) return dp[x]; if (x < min({a, b, c})) return dp[x] = INT_MIN; int n1 = (x >= a) ? solve(x - a, a, b, c) + 1 : INT_MIN; int n2 = (x >= b) ? solve(x - b, a, b, c) + 1 : INT_MIN; int n3 = (x >= c) ?
Read more →

Longest common subsequence

https://practice.geeksforgeeks.org/problems/longest-common-subsequence/0 Iterative class Solution { int dp[1005][1005]; public: int lcs(int x, int y, string s1, string s2) { for (int i = 0; i <= x; i++) { for (int j = 0; j <= y; j++) { if (i == 0 || j == 0) { dp[i][j] = 0; } else if (s1[i - 1] == s2[j - 1]) { dp[i][j] = dp[i - 1][j - 1] + 1; } else { dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]); } } } return dp[x][y]; } }; Recursive
Read more →

Longest repeated subsequence

Read more →

Longest increasing subsequence

Read more →

Space optimized solution of LCS

Read more →

LCS of three strings

Read more →

Maximum sum increasing subsequence

Read more →

Count all subsequences having product less than K

Read more →

Longest subsequence such that difference between adjacent is one

Read more →

Maximum subsequence sum such that no three are consecutive

Read more →

Egg dropping

Read more →

Maximum length chain of pairs

Read more →

Maximum size square sub-matrix with all 1s

Read more →

Maximum sum of pairs with specific difference

Read more →

Min cost path

Read more →

Maximum difference of zeros and ones in binary string

Read more →

Minimum cost to fill given weight in a bag

Read more →

Minimum removals from array to make max - min <= K

Read more →

Longest common substring

Read more →

Count number of ways to reach a given score in a game

Read more →

Count balanced binary trees of height h

Read more →

Smallest sum contiguous subarray

Read more →

Unbounded knapsack

Read more →

Largest independent set

Read more →

Longest palindromic subsequence

Read more →

Longest palindromic substring

Read more →

Longest alternating subsequence

Read more →

Weighted job scheduling

Read more →

Coin game winner where every player has three choices

Read more →

Count derangements

Read more →

Optimal strategy for a game

Read more →

Optimal binary search tree

Read more →

Palindrome partitioning

Read more →

Mobile numeric keypad

Read more →

Boolean parenthesization

Read more →

Largest rectangular sub-matrix whose sum is 0

Read more →

Largest area rectangular sub-matrix with equal number of 1s and 0s

Read more →

Maximum sum rectangle in a 2D matrix

Read more →

Maximum profit by buying and selling a share at most K times

Read more →

Find if a string is interleaved of two other strings

Read more →

Maximum length of pair chain

Read more →