Комментарии:
muhva tedd krke kaahe bolat h.. but video is good thanks man
ОтветитьHow do I fill the first row if I don't have 1 denomination coin? or is this solution requires us to have a coin of denomination of 1?
ОтветитьThoooooooo = Two -_-
Ответитьgreat tutorial
Ответитьif you are planning to talk about various approaches as asked at other comments, please include complexity discussion as well.
ОтветитьIf we don't have $1 bill then what happen in 1st row?
Ответить8 plus 1 so 2
ОтветитьGreat sir🙏
ОтветитьThis logic fails for this input.....
NO OF COINS 3
COINS ARE 8,14,17
SUM 39
EXPECTED OUTPUT 3
OUTPUT WE GET 0
apka room ma light ni ha? 1 bulb hi lga lo nazar kamzoor krni ha?
Ответитьthxx man it will save me an hour in examination...its jst amazing! truly grateful to you..
Ответитьdenominations [6,8,9] amount 7
what would be the table values? I mean for eg, take ways at index 7, according to the solution we get 1 but in reality how can you give change to 7 using which 1 coin???
Above explained solution does not work for coin array starting with not 1 like [2,5,6,8] and finally if you take min(),...0 is final answer!!!!!!!!!!!!
Ответитьsuperb explanation and Thank You Tushar Sir....
ОтветитьThe solution won't work if no denominations are possible.
ОтветитьIt feels as if I am cramming the solution
Ответить@Tushar Roy - You just started with the solution without explaining why ? It's not going to help anyone if we have to memorize it without knowing y.
Ответитьfor Dp, watch ADITYA VERMA DP PLAYLIST
ОтветитьI have watched 4 different types of Money change Dynamic Programming videos, this is so far the best, beating the lecture video from Coursera Algorithm course. If you wanna learn it, watch this first.
ОтветитьNot good explaination for filling the array elements (matrix)
ОтветитьMore appropriate title would say " infinite denominations of same coin available"
Ответитьtot=11
c=[1,5,6,8]
table=[[tot+1 for i in range(tot+1)]for x in range(len(c))]
print(table)
for i in range(tot+1):
table[0][i]=i
for i in range(len(c)):
table[i][0]=0
print(table)
for i in range(1,len(table)):
for j in range(1,len(table[i])):
if(j%c[i]==0):
table[i][j]=table[i][j-c[i]]+1
else:
p=table[i][j-1]+1
q=table[i][j-c[i]]+1
r=table[i-1][j]
print(i,j,"i,j")
print(min(p,q,r))
table[i][j]=min(p,q,r)
# if(table[i][j-1]+1<table[i][j-c[i]<table[i-1][j]):
# table[i][j]=table[i][j-1]+1
# elif:
# table[i][j]=table[i-1][j]
for i in table:
print(i)
Thank you so much tushar. Your explanation is really the best and when I tried to code with your explanation. It was very easy and finally when the output came. Really it builds my confidence that I can also code. Thanks for the video
Ответитьthanks bro very helpful :)
Ответитьpain in ear,how u uploased this shit without even checking the sound,i cant watch sorry,buy a microphone then teach
ОтветитьHow will the initialization wrok if lets say coins[ ] = {2,4,6} ??? As in this example coins[0] was 1..therefore it worked...
Can anyone explain the initilization part..?
wondering if it really solves the problem by writing the core logic you provided in the video. I tried but it didnt work for me,
ОтветитьI am not sure if we really need 2D Dp. I did in one
memo[0] = 0;
for (int i = 1; i <= amount; i++) {
for (int j = 0; j < coins.length; j++) {
if (i >= coins[j]) {
memo[i] = Math.min(memo[i], 1 + memo[i-coins[j]]);
}
}
}
return memo[amount];
lol i guess i understood everything until the final minute when you ran coding with no pauses
ОтветитьNot very good teaching. Sorry to say
ОтветитьKindly use good microphone
ОтветитьYou are brilliant.. simply elegantly brilliant
ОтветитьHi , Great video , but can you please tell me why are we taking Integer.MAX_VALUE -1 for intialization in the first row and why not Integer.MAX_VALUE ???
ОтветитьI'm so confused by this
Ответитьwhat if the first number is higher than one
ex,: 5
i can asking you if not changing = total how to code ?
ОтветитьExcellent explaination💯💯💯
ОтветитьWhat about examples where 1 isn't a coin denomination? Then there is no "top" value to use
ОтветитьLanguage bilkul ni smjh ati apki thoda theek se bol lo
Ответитьso quick and understanding easy to grasp
ОтветитьFinds min number of coin you will give as a change for example
Ответитьthank you sm
ОтветитьNice explanation solved my doubt thank you 💜
Ответить