Dynamic Programming
Dynamic Programming
Dynamic
Programming
Roadmap
if ( num <= 1)
return num;
return num;
return dp[num];
Design MERN
results in a matrix.
Guaranteed
Hiring
Highest
1 0-1 knapsack:
You are given weights and values of N items, put these items
item.
to given sum.
into two parts such that the sum of elements in both parts is
the same.
the symbols '+' and '-' before each integer in nums and then
· For example, if nums = [2, 1], you can add a '+' before 2 and a
"+2-1".
The task is to fill the knapsack in such a way that we can get
Practice
Question Asked in:
6 Coin change
kind of coin.
the pieces.
should perform a cut at. You should perform the cuts in order, you
can change the order of the cuts as you wish.The cost of one cut is
the length of the stick to be cut, the total cost is the sum of costs of
all cuts. When you cut a stick, it will be split into two smaller sticks
(i.e. the sum of their lengths is the length of the stick before the cut).
The days of the year in which you will travel are given as an
latin alphabets.
Given two strings str1 and str2, return the shortest string that
length in s.
string.
ith character from string str if and only if that ith character
You are given two strings s and t. Now your task is to print all
same.
string.
17 Edit Distance
Insert a character
Delete a character
Replace a character
unique paths that the robot can take to reach the bottom-
right corner.
19 Unique Paths II
1][n - 1]). The robot can only move either down or right at any
point in time.
grid. A path that the robot takes cannot include any square
that is an obstacle.
path from top left to bottom right, which minimizes the sum of
Note: You can only move either down or right at any point in
time.
possible paths that the rat can take to reach from source to
the source cell is 0, the rat cannot move to any other cell.
other.
me achieve my goals!!
initially positioned in the top-left room and must fight his way
the first room the knight enters and the bottom-right room
Tutort Benefits
There exists a floor f where 0 <= f <= K such that any egg
dropped from a floor higher than f will break, and any egg
above.
partition is a palindrome.
27 Word Break
following algorithm:
them in the same order. i.e., after this step, s may become
s = x + y or s = y + x.
x and y.
where the ith box has height h, width w and length l. Your task
dimensions of the 2-D base of the lower box are each strictly
larger than those of the 2-D base of the higher box. Of course,
you can rotate a box so that any side functions as its base.It
30 Wildcard Matching
wildcard pattern matching with support for '?' and '*' where:
partial).
Explore More
www.tutort.net
Follow us on