Dynamic Programming
72 problems to practice.
Super Ugly Number
1. Write a program to find the nth super ugly number. 2. Super ugly numbers are positive numbers w...
Burst Balloons
1. There are n balloons and each balloon has a number on it given as an array 2. You need to burst...
Cherry Pickup
1. You will be given a grid of the park, which contains only: 0 (empty path), 1 (cherry), -1(thorn)...
Regular Expression Matching
1. You will be given an text string S and a pattern P 2. You need to check if string matches the...
Rod Cutting
1. You will be given a rod of length n units and an integer array of prices that consists of prices...
Russian Doll Envelopes
1. You will be given an Integer array of envelopes that consists of their widths and heights 2. Yo...
Scramble String
1. You will be given 2 strings s1 and s2, assuming you make a binary tree out of it by partioning it...
Temple Offerings
1. You will be given an Integer array consisting of height of temples along a range of mountains 2...
Word Break
1. You will be given a string and a dictonary of words 2. You need to find if the given string can...
Optimal Strategy For A Game
1. You are given N coins as an integer array, size of array is even 2. You are playing against an...
Longest Bitonic Subsequence
1.Given an array of positive integers. 2.Your task is to print the maximum length of Bitonic subse...
Count Palindromic Subsequences
1.Given a String 'S'. 2.You have to find count of Palindromic Subsequence of a String. 3.Your...
Longest Common Subsequence
1.Given two Strings 2.Find the length of longest subsequence present in both of them. 3.Both the...
Longest Common Substring
1.Given two strings X and Y. The task is to find the length of the longest common substring. 2.You...
Longest Increasing Subsequence
1.Given an unsorted array of integers 2.Find the length of longest increasing subsequence. 3.You...
Distinct Transformations
1. You will be given 2 strings s and t 2. You need to find count of unique ways one can make a sub...
Edit Distance
1. You will be given 2 words: word1 and word2 2. Given that in each move you can only perform the...
Frog Jump
1. There is a frog who has to cross the river by jumping on stones, the river is divided into x unti...
Maximum Difference Of Zeros And Ones In Binary String
1.Given a binary string of 0s and 1s 2.You have to find the maximum difference of number of 0s and...
Maximum Length Of Repeated Subarray
1.Given two integer arrays A and B 2.You have to complete the function max() that should return th...
Maximum Sum Increasing Subsequence
1. You are given an array of integers. 2. You have to find the sum of the subsequence which is str...
Minimum Ascii Delete Sum For Two Strings
1. You are given two strings s1 and s2 2. Delete characters is s1 and s2 to make the two strings e...
Minimum Cost For Tickets
1. You are going on a vacation for a year, you've decided certain days for travelling in the city, g...
Minimum Cost To Make Two Strings Identical
1. You are given 2 strings (str1 and str2) and the cost of removing a character from the respective...
Maximum Non-overlapping Bridges
1. You are given a number n, representing the number of bridges on a river. 2. You are given n pair...
Longest Palindromic Subsequences
1. You are given a string str. 2. You are required to print the length of longest palindromic subse...
Count Palindromic Substrings
1. You are given a string str. 2. You are required to print the count of palindromic substrings in...
Catalan Number
1. You are given a number n. 2. You are required to find the value of nth catalan number. C0 -> 1...
Number Of Bsts
1. You are given a number n, representing the number of elements. 2. You are required to find the n...
Count Of Valleys And Mountains
1. You are given a number n, representing the number of upstrokes / and number of downstrokes . 2....
Count Brackets
1. You are given a number n, representing the number of opening brackets ( and closing brackets ) 2...
Optimal Binary Search Tree
1. You are given two arrays - The first array(keys), which is sorted and has distinct integer...
Minimum Score Of Triangulation
1. You are given an array of integers, which represents the vertices of an N-sided convex polygon in...
Circle And Chords
1. You are given a number N. 2. There are 2*N points on a circle. You have to draw N non-intersecti...
Matrix Chain Multiplication
1. You are given an array(arr) of positive integers of length N which represents the dimensions of N...
Minimum Palindromic Cut
1. You are given a string. 2. You have to find the minimum number of cuts required to convert the g...
Boolean Parenthesization
1. You are given a boolean expression with symbols T,F, and operators &,|,^ , where T represents...
Egg Drop
1. You are given two integers N and K. N represents the number of eggs and K represents the number o...
Min Squares
1. You are given a number N. 2. You have to find the minimum number of squares that sum to N. 3. Y...
Numeric Keypad
1. You are given a number N, which represents the count of buttons pressed on a mobile numeric keypa...
Probability Of Knight In The Chessboard
1. You are given a N*N chessboard and the starting position of the knight in the chessboard. 2. The...
Arithmetic Slices 1
1. You are given an array(arr) of integers. 2. You have to find the count of arithmetic slices in t...
Arithmetic Slices 2
1. You are given an array(arr) of integers. 2. You have to find the count of arithmetic slices in t...
2 Key Keyboard
1. You are given a number N. 2. You have to print exactly N number of 'X' on a notepad by performin...
Highway Billboard
1. You are given a number M representing length of highway(range). 2. You are given a number N repr...
Largest Square Sub-matrix With All 1's
1. You are given a matrix of 0's and 1's. 2. You have to find the maximum size square sub-matrix wi...
Minimum Insertions To Make Palindrome
1. You are given a string(str). 2. You have to find the minimum number of characters to be inserted...
Print All Paths With Minimum Cost
1. You are given a number n, representing the number of rows. 2. You are given a number m, represen...
Print All Paths With Maximum Gold
1. You are given a number n, representing the number of rows. 2. You are given a number m, represen...
Print All Paths With Minimum Jumps
1. You are given a number N representing number of elements. 2. You are given N space separated num...
Print All Longest Increasing Subsequences
1. You are given a number N representing number of elements. 2. You are given N space separated num...
Print All Results In 0-1 Knapsack
1. You are given a number n, representing the count of items. 2. You are given n numbers, represent...
Count Distinct Subsequences
1. You are given a string. 2. You have to print the count of distinct and non-empty subsequences of...
Count Of Distinct Palindromic Subsequences
1. You are given a string. 2. You have to print the count of distinct and non-empty palindromic sub...
Print All Paths With Target Sum Subset
1. You are given a number n, representing the count of elements. 2. You are given n numbers. 3. Yo...
Wildcard Pattern Matching
1. You are given two strings S1 and S2. S1 represents a text and S2 represents a wildcard pattern....
Longest Repeating Subsequence
1. You are given a string str. 2. You have to find the length of longest subsequence which is appea...
Kadane's Algorithm
1. You are given an array(arr) of integers. 2. You have to find maximum subarray sum in the given a...
K Concatenation
1. You are given an array(arr1) of integers and an integer k. 2. Another array(arr2) is formed by c...
Maximum Sum Subarray With At Least K Elements
1. You are given an array(arr) of integers and a number k. 2. You have to find maximum subarray sum...
Maximum Sum Of Three Non-overlapping Subarrays
1. You are given an array(arr) of positive numbers and a number K. 2. You have to find the maximum...
Maximum Sum Of M Non-overlapping Subarrays
1. You are given an array(arr) of positive numbers and two numbers M and K. 2. You have to find the...
Number Of Ways Of Triangulation
1. You are given a number N, which represents the number of sides in a polygon. 2. You have to find...
Ugly Number
1. You are given a number N. 2. You have to find Nth ugly number. 3. Ugly number is defined as the...
Find Water In Glass
1. Pepcoder arranged some glasses in the form of pascal triangle. 2. Capacity of each glass is 1 li...
Interleaving Of Two Strings
1. You are given three strings - s1, s2 and s3. 2. You have to find whether s3 is formed by interle...
Distinct Echo Substrings
https://leetcode.com/problems/distinct-echo-substrings/
Minimum Cost To Cut A Stick
https://leetcode.com/problems/minimum-cost-to-cut-a-stick/
Delete And Earn
<a href="https://leetcode.com/problems/delete-and-earn/">https://leetcode.com/problems/delete-...
Number Of Good Ways To Split A String
https://leetcode.com/problems/number-of-good-ways-to-split-a-string/
Maximum Alternating Subsequence Sum
https://leetcode.com/problems/maximum-alternating-subsequence-sum/
Stone Game
https://leetcode.com/problems/stone-game-vii/