Coin Change - Leetcode 322 - Dynamic Programming (Python)

  Рет қаралды 12,188

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 31
@GregHogg
@GregHogg 6 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@adilmolzhigitov4381
@adilmolzhigitov4381 Ай бұрын
Thanks, that was really good explanation. After watching your tutorials I also started actively using Paint when solving leetcode
@EquinoXReZ
@EquinoXReZ 9 күн бұрын
Me too! Paint ftw! I'm wondering if they will let me use it in an interview
@ibraheem_Zain
@ibraheem_Zain 7 ай бұрын
That was clear as sun and helpful even if you use python. Thanks sir you are awesome 👍😎❤
@GregHogg
@GregHogg 7 ай бұрын
Awesome super glad it was helpful 😊
@tarilonte
@tarilonte 5 ай бұрын
Your explanation is cristal clear! Thanks a lot for this great video!
@yingxie9974
@yingxie9974 26 күн бұрын
Thanks for great explanation ! I like your smile !
@dp8jl
@dp8jl 2 ай бұрын
Used to think this is a backtracking question 😂 and failed multiple times, thanks for a great explanation
@Alex-tm5hr
@Alex-tm5hr 6 ай бұрын
Great job, imo better than neetcode's solution for the draw out part
@GregHogg
@GregHogg 6 ай бұрын
Yay!
@internick_
@internick_ 4 ай бұрын
Why did we have to sort the coins in ascending order? Not sure why it becomes an issue if we always consider every coin, still
@AI_STORY_JJANG
@AI_STORY_JJANG 3 ай бұрын
I also don't think we need sorting
@arnobchowdhury9641
@arnobchowdhury9641 2 ай бұрын
Sorting is important for breaking out of the loop early. Check line 15 and 16.
@darshandani1
@darshandani1 5 ай бұрын
Great explanation ! Thanks !
@AlaaEddineMecha
@AlaaEddineMecha 9 күн бұрын
Could you add an explanation on how to solve coin change 2?
@mansurischanov3204
@mansurischanov3204 6 ай бұрын
thanks dude, this makes so much sense now!
@GregHogg
@GregHogg 6 ай бұрын
Glad to hear it, this is a tricky one!
@ayushdey5342
@ayushdey5342 7 ай бұрын
what is the name of the blackboard app that you use to draw stuff? its really good looking
@GregHogg
@GregHogg 7 ай бұрын
Yes it's awesome. It's miro
@new-anointingaremu3597
@new-anointingaremu3597 7 ай бұрын
This explanation is great thanks a lot
@GregHogg
@GregHogg 7 ай бұрын
Awesome happy to hear it!
@carefree_ladka
@carefree_ladka 4 ай бұрын
Sorting is O(NlogN). Why didn't we consider this in time complexity?
@ArtyomKonoplya
@ArtyomKonoplya 3 ай бұрын
cause len(coins) way too smaller than amount value
@astronautgamer34
@astronautgamer34 7 ай бұрын
plz explain coin change two it so hard for me to understand
@GregHogg
@GregHogg 7 ай бұрын
I haven't solved this, I'll have to take a look at some point :)
@Krish-hk1bt
@Krish-hk1bt 4 ай бұрын
hei, you are saying "smallest number of ways to make a coin" , isn't it the "minimum number of coins"?
@AlaaEddineMecha
@AlaaEddineMecha 12 күн бұрын
Imposter syndrom hitting again :((( When I watch the video, it makes a lot of sense but I keep blaming myself...
@adesopekingsley9967
@adesopekingsley9967 7 ай бұрын
I was thinking 🤔 We can sort reverse the list then pick the biggest number at index 0 then check if its greater than amount if false, then next but if true subtract from amount index. Check if result is present in the list [can use a set] if flase then call recursion using to repeat using result Example amount 12 List=[1,4,5] List.sort(reverse=True) 12>5.. therefore 12-5= 7 7 not in list and greater than 5 7>5 therefore 7-5=2 2
@贪财
@贪财 7 ай бұрын
$4x3 =$12. So fewest is 3 coins. 5+5+1+1 is 4coins. it cover most but edge
@CGS9_
@CGS9_ 7 ай бұрын
@@贪财 always those edge cases that will get ya
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Coin Change - Dynamic Programming Bottom Up - Leetcode 322
19:23
Pacific Atlantic Water Flow - Leetcode 417 - Graphs (Python)
17:10
House Robber - Leetcode 198 - Dynamic Programming (Python)
13:15
Recursive Backtracking - DSA Course in Python Lecture 14
12:58
Spiral Matrix - Leetcode 54 - Arrays & Strings (Python)
8:32
Greg Hogg
Рет қаралды 11 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
The Change Making Problem - Fewest Coins To Make Change Dynamic Programming
23:12
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН