Dynamic Programming

72 problems to practice.

72 Total
37 Easy
29 Medium
6 Hard

Super Ugly Number

1. Write a program to find the nth super ugly number. 2. Super ugly numbers are positive numbers w...

easy

Burst Balloons

1. There are n balloons and each balloon has a number on it given as an array 2. You need to burst...

easy

Cherry Pickup

1. You will be given a grid of the park, which contains only: 0 (empty path), 1 (cherry), -1(thorn)...

easy

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...

easy

Rod Cutting

1. You will be given a rod of length n units and an integer array of prices that consists of prices...

easy

Russian Doll Envelopes

1. You will be given an Integer array of envelopes that consists of their widths and heights 2. Yo...

easy

Scramble String

1. You will be given 2 strings s1 and s2, assuming you make a binary tree out of it by partioning it...

easy

Temple Offerings

1. You will be given an Integer array consisting of height of temples along a range of mountains 2...

easy

Word Break

1. You will be given a string and a dictonary of words 2. You need to find if the given string can...

easy

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...

easy

Longest Bitonic Subsequence

1.Given an array of positive integers. 2.Your task is to print the maximum length of Bitonic subse...

easy

Count Palindromic Subsequences

1.Given a String 'S'. 2.You have to find count of Palindromic Subsequence of a String. 3.Your...

easy

Longest Common Subsequence

1.Given two Strings 2.Find the length of longest subsequence present in both of them. 3.Both the...

easy

Longest Common Substring

1.Given two strings X and Y. The task is to find the length of the longest common substring. 2.You...

easy

Longest Increasing Subsequence

1.Given an unsorted array of integers 2.Find the length of longest increasing subsequence. 3.You...

easy

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...

easy

Edit Distance

1. You will be given 2 words: word1 and word2 2. Given that in each move you can only perform the...

easy

Frog Jump

1. There is a frog who has to cross the river by jumping on stones, the river is divided into x unti...

easy

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...

easy

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...

easy

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...

easy

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...

easy

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...

medium

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...

easy

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...

easy

Longest Palindromic Subsequences

1. You are given a string str. 2. You are required to print the length of longest palindromic subse...

medium

Count Palindromic Substrings

1. You are given a string str. 2. You are required to print the count of palindromic substrings in...

medium

Catalan Number

1. You are given a number n. 2. You are required to find the value of nth catalan number. C0 -> 1...

easy

Number Of Bsts

1. You are given a number n, representing the number of elements. 2. You are required to find the n...

medium

Count Of Valleys And Mountains

1. You are given a number n, representing the number of upstrokes / and number of downstrokes . 2....

easy

Count Brackets

1. You are given a number n, representing the number of opening brackets ( and closing brackets ) 2...

easy

Optimal Binary Search Tree

1. You are given two arrays - The first array(keys), which is sorted and has distinct integer...

easy

Minimum Score Of Triangulation

1. You are given an array of integers, which represents the vertices of an N-sided convex polygon in...

medium

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...

easy

Matrix Chain Multiplication

1. You are given an array(arr) of positive integers of length N which represents the dimensions of N...

medium

Minimum Palindromic Cut

1. You are given a string. 2. You have to find the minimum number of cuts required to convert the g...

easy

Boolean Parenthesization

1. You are given a boolean expression with symbols T,F, and operators &,|,^ , where T represents...

easy

Egg Drop

1. You are given two integers N and K. N represents the number of eggs and K represents the number o...

hard

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...

easy

Numeric Keypad

1. You are given a number N, which represents the count of buttons pressed on a mobile numeric keypa...

medium

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...

medium

Arithmetic Slices 1

1. You are given an array(arr) of integers. 2. You have to find the count of arithmetic slices in t...

medium

Arithmetic Slices 2

1. You are given an array(arr) of integers. 2. You have to find the count of arithmetic slices in t...

hard

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...

medium

Highway Billboard

1. You are given a number M representing length of highway(range). 2. You are given a number N repr...

medium

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...

medium

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...

easy

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...

medium

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...

medium

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...

medium

Print All Longest Increasing Subsequences

1. You are given a number N representing number of elements. 2. You are given N space separated num...

easy

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...

medium

Count Distinct Subsequences

1. You are given a string. 2. You have to print the count of distinct and non-empty subsequences of...

easy

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...

medium

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...

medium

Wildcard Pattern Matching

1. You are given two strings S1 and S2. S1 represents a text and S2 represents a wildcard pattern....

medium

Longest Repeating Subsequence

1. You are given a string str. 2. You have to find the length of longest subsequence which is appea...

medium

Kadane's Algorithm

1. You are given an array(arr) of integers. 2. You have to find maximum subarray sum in the given a...

easy

K Concatenation

1. You are given an array(arr1) of integers and an integer k. 2. Another array(arr2) is formed by c...

medium

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...

medium

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...

hard

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...

hard

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...

easy

Ugly Number

1. You are given a number N. 2. You have to find Nth ugly number. 3. Ugly number is defined as the...

medium

Find Water In Glass

1. Pepcoder arranged some glasses in the form of pascal triangle. 2. Capacity of each glass is 1 li...

medium

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...

medium

Distinct Echo Substrings

https://leetcode.com/problems/distinct-echo-substrings/

hard

Minimum Cost To Cut A Stick

https://leetcode.com/problems/minimum-cost-to-cut-a-stick/

hard

Delete And Earn

<a href="https://leetcode.com/problems/delete-and-earn/">https://leetcode.com/problems/delete-...

medium

Number Of Good Ways To Split A String

https://leetcode.com/problems/number-of-good-ways-to-split-a-string/

medium

Maximum Alternating Subsequence Sum

https://leetcode.com/problems/maximum-alternating-subsequence-sum/

medium

Stone Game

https://leetcode.com/problems/stone-game-vii/

medium