Coin Changing Minimum Number of Coins Dynamic programming

Coin Changing Minimum Number of Coins Dynamic programming

496,278 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@anuragchaudhary4915
@anuragchaudhary4915 - 02.09.2020 23:03

muhva tedd krke kaahe bolat h.. but video is good thanks man

Ответить
@tejasvigupta07
@tejasvigupta07 - 03.09.2020 20:25

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?

Ответить
@duedares
@duedares - 24.09.2020 17:59

Thoooooooo = Two -_-

Ответить
@sainathtallam9262
@sainathtallam9262 - 11.10.2020 10:38

great tutorial

Ответить
@santhoshramananr2007
@santhoshramananr2007 - 26.10.2020 16:15

if you are planning to talk about various approaches as asked at other comments, please include complexity discussion as well.

Ответить
@jesanahammedovi9061
@jesanahammedovi9061 - 15.11.2020 11:51

If we don't have $1 bill then what happen in 1st row?

Ответить
@mahmudulhasan5736
@mahmudulhasan5736 - 12.12.2020 01:21

8 plus 1 so 2

Ответить
@riyankpatel9410
@riyankpatel9410 - 06.01.2021 15:25

Great sir🙏

Ответить
@sankeerthmeda6088
@sankeerthmeda6088 - 08.01.2021 17:53

This logic fails for this input.....
NO OF COINS 3
COINS ARE 8,14,17
SUM 39
EXPECTED OUTPUT 3
OUTPUT WE GET 0

Ответить
@ehtishamshami3146
@ehtishamshami3146 - 22.01.2021 00:09

apka room ma light ni ha? 1 bulb hi lga lo nazar kamzoor krni ha?

Ответить
@rahilthakkar6007
@rahilthakkar6007 - 28.01.2021 20:17

thxx man it will save me an hour in examination...its jst amazing! truly grateful to you..

Ответить
@pranaysanam
@pranaysanam - 04.02.2021 04:00

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

Ответить
@sanakachiranjeevieuro3037
@sanakachiranjeevieuro3037 - 19.03.2021 10:19

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

Ответить
@stith_pragya
@stith_pragya - 19.03.2021 14:44

superb explanation and Thank You Tushar Sir....

Ответить
@shobhitranjan3957
@shobhitranjan3957 - 27.04.2021 14:54

The solution won't work if no denominations are possible.

Ответить
@rahuldevgupta4513
@rahuldevgupta4513 - 15.05.2021 11:55

It feels as if I am cramming the solution

Ответить
@kittyjain4682
@kittyjain4682 - 22.05.2021 19:39

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

Ответить
@SHASHANKRUSTAGII
@SHASHANKRUSTAGII - 30.06.2021 14:46

for Dp, watch ADITYA VERMA DP PLAYLIST

Ответить
@shelllu6888
@shelllu6888 - 12.07.2021 01:21

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.

Ответить
@buzzfeedRED
@buzzfeedRED - 19.07.2021 13:25

Not good explaination for filling the array elements (matrix)

Ответить
@cristianouzumaki2455
@cristianouzumaki2455 - 08.08.2021 22:01

More appropriate title would say " infinite denominations of same coin available"

Ответить
@sharonbinto
@sharonbinto - 25.09.2021 19:13

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)

Ответить
@sharonbinto
@sharonbinto - 26.09.2021 08:07

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

Ответить
@mohammedsafwan4447
@mohammedsafwan4447 - 10.10.2021 14:21

thanks bro very helpful :)

Ответить
@utkarshgautam1940
@utkarshgautam1940 - 26.10.2021 23:44

pain in ear,how u uploased this shit without even checking the sound,i cant watch sorry,buy a microphone then teach

Ответить
@AyushRaj-pm1dz
@AyushRaj-pm1dz - 20.11.2021 10:30

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

Ответить
@sheenamjindal6703
@sheenamjindal6703 - 13.12.2021 15:51

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,

Ответить
@prettythings5572
@prettythings5572 - 16.12.2021 03:42

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];

Ответить
@allanmagalhaes8211
@allanmagalhaes8211 - 21.12.2021 19:58

lol i guess i understood everything until the final minute when you ran coding with no pauses

Ответить
@darthvadar2915
@darthvadar2915 - 10.01.2022 13:34

Not very good teaching. Sorry to say

Ответить
@shubrochakroborty5918
@shubrochakroborty5918 - 21.03.2022 09:41

Kindly use good microphone

Ответить
@qwarlock4126
@qwarlock4126 - 04.07.2022 01:17

You are brilliant.. simply elegantly brilliant

Ответить
@vasanthanv6143
@vasanthanv6143 - 22.09.2022 08:22

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

Ответить
@fallingstar_Yas
@fallingstar_Yas - 02.12.2022 06:11

I'm so confused by this

Ответить
@jan_ek_7869
@jan_ek_7869 - 01.04.2023 12:32

what if the first number is higher than one
ex,: 5

Ответить
@05.nguyenkhanhduy9
@05.nguyenkhanhduy9 - 24.05.2023 13:28

i can asking you if not changing = total how to code ?

Ответить
@joyshah_22
@joyshah_22 - 04.12.2023 10:26

Excellent explaination💯💯💯

Ответить
@BRBallin1
@BRBallin1 - 11.03.2024 11:00

What about examples where 1 isn't a coin denomination? Then there is no "top" value to use

Ответить
@viral.videos262
@viral.videos262 - 31.03.2024 09:17

Language bilkul ni smjh ati apki thoda theek se bol lo

Ответить
@subhashreesahu692
@subhashreesahu692 - 17.04.2024 21:48

so quick and understanding easy to grasp

Ответить
@ivandrofly
@ivandrofly - 06.05.2024 00:15

Finds min number of coin you will give as a change for example

Ответить
@annshi4775
@annshi4775 - 27.07.2024 20:30

thank you sm

Ответить
@swadheenta.957VBTS
@swadheenta.957VBTS - 10.10.2024 22:20

Nice explanation solved my doubt thank you 💜

Ответить