Coin Change - Leetcode 322 - Dynamic Programming (Python)

  Рет қаралды 9,015

Greg Hogg

Greg Hogg

Күн бұрын

Master Data Structures & Algorithms for FREE at AlgoMap.io/
Code solutions in Python, Java, C++ and JS for this can be found at my GitHub repo here: github.com/gah...
Complete DSA Pathway Zero to Hero: • Data Structures & Algo...
Please check my playlists for free DSA problem solutions:
• Fundamental DSA Theory
• Array & String Questions
• 2 Pointers Questions
• Sliding Window Questions
• Binary Search Questions
• Stack Questions
• Linked List Questions
• Tree Questions
• Heap Questions
• Recursive Backtracking...
• Graph Questions
• Dynamic Programming (D...
My Data Science & ML KZbin Playlist: • Greg's Path to Become ...
Learn Python and Data Science FASTER at mlnow.ai :)
Support the content: / @greghogg
Follow me on Instagram: / greghogg5
Connect with me on LinkedIn: / greghogg
Follow me on TikTok: / greghogg5
Coursera Plus: imp.i384100.ne...
My Favorite Courses:
Data Structures & Algorithms:
UCalifornia San Diego DSA: imp.i384100.ne...
Stanford Algorithms: imp.i384100.ne...
Python Data Structures: imp.i384100.ne...
Meta Coding Interview Prep: imp.i384100.ne...
Python:
UMichigan Python for Everybody: imp.i384100.ne...
Python Mastery from MLNOW.ai: mlnow.ai/cours...
Google IT Automation w/ Python: imp.i384100.ne...
Web Dev / Full Stack:
Meta Front-End Developer: imp.i384100.ne...
IBM Full Stack Developer: imp.i384100.ne...
Meta Back-End Developer: imp.i384100.ne...
John Hopkins HTML, CSS & JS: imp.i384100.ne...
IBM DevOps: imp.i384100.ne...
Cloud Development:
AWS Fundamentals: imp.i384100.ne...
GCP Cloud Engineer: imp.i384100.ne...
Microsoft Azure Fundamentals: imp.i384100.ne...
Game Development:
Michigan State Unity Development: imp.i384100.ne...
UColorado C++ for Unreal Engine: www.coursera.o...
SQL & Data Science:
SQL by MLNOW.ai: mlnow.ai/cours...
Python for Data Science by MLNOW.ai: mlnow.ai/cours...
Google Data Analytics: imp.i384100.ne...
IBM Data Science: imp.i384100.ne...
IBM Data Engineer: imp.i384100.ne...
Machine Learning & AI:
ML Mastery at MLNOW.ai: mlnow.ai/cours...
ML w/ Andrew Ng: www.coursera.o...
Deep Learning w/ Andrew Ng: imp.i384100.ne...

Пікірлер: 26
@GregHogg
@GregHogg 4 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@dp8jl
@dp8jl Күн бұрын
Used to think this is a backtracking question 😂 and failed multiple times, thanks for a great explanation
@ibraheem_Zain
@ibraheem_Zain 5 ай бұрын
That was clear as sun and helpful even if you use python. Thanks sir you are awesome 👍😎❤
@GregHogg
@GregHogg 5 ай бұрын
Awesome super glad it was helpful 😊
@tarilonte
@tarilonte 3 ай бұрын
Your explanation is cristal clear! Thanks a lot for this great video!
@Alex-tm5hr
@Alex-tm5hr 4 ай бұрын
Great job, imo better than neetcode's solution for the draw out part
@GregHogg
@GregHogg 4 ай бұрын
Yay!
@internick_
@internick_ 2 ай бұрын
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 Ай бұрын
I also don't think we need sorting
@arnobchowdhury9641
@arnobchowdhury9641 20 күн бұрын
Sorting is important for breaking out of the loop early. Check line 15 and 16.
@carefree_ladka
@carefree_ladka Ай бұрын
Sorting is O(NlogN). Why didn't we consider this in time complexity?
@ArtyomKonoplya
@ArtyomKonoplya Ай бұрын
cause len(coins) way too smaller than amount value
@darshandani1
@darshandani1 3 ай бұрын
Great explanation ! Thanks !
@mansurischanov3204
@mansurischanov3204 4 ай бұрын
thanks dude, this makes so much sense now!
@GregHogg
@GregHogg 4 ай бұрын
Glad to hear it, this is a tricky one!
@new-anointingaremu3597
@new-anointingaremu3597 5 ай бұрын
This explanation is great thanks a lot
@GregHogg
@GregHogg 5 ай бұрын
Awesome happy to hear it!
@ayushdey5342
@ayushdey5342 5 ай бұрын
what is the name of the blackboard app that you use to draw stuff? its really good looking
@GregHogg
@GregHogg 5 ай бұрын
Yes it's awesome. It's miro
@astronautgamer34
@astronautgamer34 5 ай бұрын
plz explain coin change two it so hard for me to understand
@GregHogg
@GregHogg 5 ай бұрын
I haven't solved this, I'll have to take a look at some point :)
@adesopekingsley9967
@adesopekingsley9967 5 ай бұрын
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
@贪财
@贪财 5 ай бұрын
$4x3 =$12. So fewest is 3 coins. 5+5+1+1 is 4coins. it cover most but edge
@CGS9_
@CGS9_ 5 ай бұрын
@@贪财 always those edge cases that will get ya
@Krish-hk1bt
@Krish-hk1bt Ай бұрын
hei, you are saying "smallest number of ways to make a coin" , isn't it the "minimum number of coins"?
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 133 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Rotting Oranges - Leetcode 994 - Graphs (Python)
16:09
Greg Hogg
Рет қаралды 3,4 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
House Robber - Leetcode 198 - Dynamic Programming (Python)
13:15
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 147 М.
Coin Change - Dynamic Programming Bottom Up - Leetcode 322
19:23
The Change Making Problem - Fewest Coins To Make Change Dynamic Programming
23:12
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 107 М.