Тёмный

Dynamic Programming 2D - Full Course - Python 

NeetCode
Подписаться 738 тыс.
Просмотров 102 тыс.
50% 1

🚀 neetcode.io/ - A better way to prepare for Coding Interviews
Checkout my second Channel: @NeetCodeIO
🥷 Discord: / discord
🐦 Twitter: / neetcode1
⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
💡 DYNAMIC PROGRAMMING PLAYLIST: • House Robber - Leetco...
0:00 - Intro
1:10 - Unique Paths
11:48 - Longest Common Subsequence
30:00 - Best Time to Buy/Sell Stock with Cooldown
45:01 - Coin Change II
1:08:12 - Target Sum
1:20:07 - Interleaving String
1:39:19 - Longest Increasing Path in a Matrix
1:55:53 - Distinct Subsequences
2:07:10 - Edit Distance
2:27:55- Burst Balloons
2:49:01 - Regular Expression Matching
#leetcode #neetcode #python

Наука

Опубликовано:

 

24 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@learningalgos614
@learningalgos614 Год назад
I’m convinced your stuff is better than Algoexpert
@awk3340
@awk3340 Год назад
bye 110% this guy is awesome
@learningalgos614
@learningalgos614 Год назад
Why are you guys liking me lmao, like Neetcode instead
@lycan2494
@lycan2494 Год назад
to be fair i have algoexpert and that shit is good
@Tyler-jd3ex
@Tyler-jd3ex Год назад
I think they are both GREAT. I love Clement so much but Neetcode definitely has way more content for free which I appreciate dearly
@chukwunta
@chukwunta Год назад
without a doubt.
@chukwunta
@chukwunta Год назад
This is such an amazing resource. Finally I now understand 2D DP better. Thanks so much. I truly appreciate all your effort, you have bee a great asset to my journey through this algo-verse.
@kashishsingh5813
@kashishsingh5813 Год назад
Ohh Man...you are great Finally ....someone making so much comprehensive course on 2d mtrix
@dorothychristina2721
@dorothychristina2721 Год назад
Hi Bro.Please do a full course on graph problems .It would be really helpful.This video is awesome 👌
@sukanyasaha5458
@sukanyasaha5458 Год назад
Woow this is gem. Can you please please do a comprehensive video on Graph?
@raghuthetraveler
@raghuthetraveler Год назад
Your explanation is better than anything i have see online
@foxh8er
@foxh8er 4 месяца назад
A lot of these videos handwave things away, but these are really good solutions. Cheers
@yuemingpang3161
@yuemingpang3161 Год назад
Thank you very nice course on 2D dp! Just a reminder, there is a typo in the disctinct subsequences section: dfs(i+i, j) should be dfs(i+1, j) Thank you!
@strykeregziadahmed9562
@strykeregziadahmed9562 Год назад
literally you are the only one that i can complete his video without being bored
@qing1jia
@qing1jia Год назад
This is insane! Thank you so much
@JJCUBER
@JJCUBER Год назад
For the first problem, you can think of it as a scenario where you have letters that are r’s and d’s for the directions and the order of these matter. In the example, you would have 6 r’s and 2 d’s. You want to find all the possible orderings of these letters as a string/sequence. You do this by fixing the r’s then d’s (or the other way around). This means you would get (6+2) choose 2 * 6 choose 6. This is the same as 8 choose 2, which is 8*7/2=28. In general, it would be (n + m - 2) choose (n-1). You could also use (m-1) and can find the min of n and m to find out which calculation would be faster.
@yskida5
@yskida5 Год назад
Well put
@uma_918
@uma_918 Год назад
Hey, I received an offer from Amazon for SDE 2 role. I have been following you for long time now. You have a fair share in my success. Keep doing the great job.
@NeetCode
@NeetCode Год назад
That's awesome, congratulations on the offer!! And thanks for the kind words :)
@AryanSingh-zv5ch
@AryanSingh-zv5ch Год назад
Loved it thanks for the amazing explanations❤
@user-od1hv9dv8p
@user-od1hv9dv8p 4 месяца назад
As a freshman in CS, dp is such a tall ask for me to overcome. And this series save me... respect for neetcode!
@pvhung174
@pvhung174 Год назад
I want to ask, what is your thought process when youre comming up with the solution? I cant seem to figure out what to use when solving the problems.
@chrisogonas
@chrisogonas Год назад
Thanks lots for putting together this rich resource.
@Alexex2353
@Alexex2353 Год назад
Awesome, thanks!
@proshantsaha
@proshantsaha Год назад
Hi, I like the explanations you give before diving into the coding. Can you please make a video on Leetcode 310 (Minimum height tree) problem. I appreciate your altruism. Thanks
@estifanosbireda1892
@estifanosbireda1892 Год назад
Hi, can you make a detailed explanation video on leetcode 1770 for the iterative solution please. It gives TLE for the memoization approach. A big thanks for this video
@mlguy8376
@mlguy8376 Год назад
First problem you can use combinatorics - because you know you know you have to go m moves across and n down. But if you want to have any blockers or if you allowed up and down this does not hold
@thetruthsayer8347
@thetruthsayer8347 Год назад
If I learn something from this video, I’m definitely signing up for lifetime access
@hikmetdemir1032
@hikmetdemir1032 4 месяца назад
Could you please make an example training video for backtracking, graphs, tree and sliding window, starting from easy level to difficult level, just like you do for dynamic programming?
@sukanyabag6134
@sukanyabag6134 Год назад
Hi, please make a lecture on LC 1626. Best Team With No Conflicts! Love your way of teaching!!
@madhumithakolkar_
@madhumithakolkar_ 7 месяцев назад
There's actually a mistake at 2:06:00 for the problem - Distinct Subsequences, great explanation by the way ! While you've mentioned it properly , there's a typo in the code >> cache[(i,j)] = dfs(i+1,j+1)+dfs(i+i,j) This should be dfs(i+1,j) , you have mentioned it as i+i in all the places.
@RC-qr8bn
@RC-qr8bn Год назад
Have you thought about adding Swift language solutions on your website?
@hakeemdhayal8433
@hakeemdhayal8433 Год назад
Hey, could you apply tiered pricing based on where your subscribers live? Some of us in Africa really get hit hard by the exchange rate... Big time.
@satapa
@satapa Год назад
typo in the problem Distinct subsequences. It should be dfs(i+1,j) instead of dfs(i+i,j) in line 14 and 16
@Shubhakar97
@Shubhakar97 Год назад
Man this guy is awesome
@sophiophile
@sophiophile Месяц назад
For the first problem, I guess the only optimization (beyond knowing the math eq) would be selecting the smaller of m and n, so that your memory complexity is minimized.
@nipunramani
@nipunramani 9 месяцев назад
For Distinct Subsequences(2:06:10) use modulo on line 14 like this to get the correct answer when length of s is too long: if(s[i] == t[j]): cache[(i,j)] = dfs(i + 1, j + 1)%m + dfs(i + 1, j)%m here m = int(1e9+7)
@ranjithragul
@ranjithragul Год назад
Can you please consider to extend the discount sale upto end of this month.
@podilichaitanyaakhilkumar4911
Please do more videos on frequently asked questions in Maang interviews on leetcode.
@rapmusa
@rapmusa 10 месяцев назад
is 2d array dp and pointer approach the same time complexity?
@brayn7504
@brayn7504 Год назад
Explanations are good, but as someone who always wants to try and find out complete solution myself, it does take time for me and it does get a bit demotivating, so my question to you is that, did you figure out solutions to all problems by yourself or you took help or how did you approach these programming questions? Hope to get an answer.
@NeetCode
@NeetCode Год назад
I definitely had to look at the solution a lot when I first started
@brayn7504
@brayn7504 Год назад
@@NeetCode Thank you, appreciate your time and response. :)
@sidharthdhiman4522
@sidharthdhiman4522 Год назад
thanx man , when will be the system design course coming ?
@NeetCode
@NeetCode Год назад
Hopefully by end of October, but I will try to upload it as I complete each lesson
@TheKievsash
@TheKievsash 9 месяцев назад
Thank you!
@qrozes
@qrozes Год назад
Edit Distance: What if we have fourth option is exchange two adjacent character?
@lycan2494
@lycan2494 Год назад
awesome!!
@utti_12c
@utti_12c 2 месяца назад
Thank you🙏
@muhammadhassanrazzaq8122
@muhammadhassanrazzaq8122 Год назад
Thanks man .
@danz5002
@danz5002 Год назад
Christmas came early!
@gauravtiwari6550
@gauravtiwari6550 Год назад
Hey could you please make a video on LC problem number 273
@thedropshipper96
@thedropshipper96 Год назад
Shortest Path in Binary Matrix can you please solve this question leetcode 1091
@build-your-own-x
@build-your-own-x Год назад
11:50 LCS 30:00 stock selling 45:00 coin change
@himanshuchauhan940
@himanshuchauhan940 Год назад
Hey neetcode please solve the problem no 1478 of leetcode largest continuous subaaray with abs diff les than limit
@anilsailakhinana94
@anilsailakhinana94 Год назад
for coin change 2 problem dp=[0]*(amount+1) dp[0] = 1 for coin in coins: for i in range(1, amount+1): if i - coin >=0: dp[i] += dp[i-coin] return dp[-1]
@GoogleAccount-ph8mm
@GoogleAccount-ph8mm Год назад
Please make video in dynamic programming in Java
@saranshthukral4021
@saranshthukral4021 Год назад
WOOOW!
@eddiej204
@eddiej204 Год назад
Dope
@pwnweb5734
@pwnweb5734 Год назад
nice good neatcode :)
@AnonymousCoward3000
@AnonymousCoward3000 Год назад
Thanks!
@NeetCode
@NeetCode Год назад
Thank you so much 🙏🙏🙏
@krateskim4169
@krateskim4169 Год назад
awesome
@cosepeter2197
@cosepeter2197 Год назад
32. Longest Valid Parentheses can you solve this please?
@dip5548
@dip5548 Год назад
Best coding channel. End of
@xxrazorxx1073
@xxrazorxx1073 4 месяца назад
why did burst ballon become max coins?
@jay-rathod-01
@jay-rathod-01 Год назад
Yeah baby.❤
@lembueno894
@lembueno894 Год назад
You would increase the quality of my life if you made discrete math videos (you know the math needed for CS). Stuff like Karatsuba's, Recursion Tree's, Induction Proofs, Asympotic time complexity would really help!
@lembueno894
@lembueno894 Год назад
since you are doing not strictly leetcode and all
@el1398
@el1398 Год назад
When is the sale gonna last until?
@NeetCode
@NeetCode Год назад
About 1 more week
@iseeflowers
@iseeflowers Год назад
@@NeetCode what is difference of the content on your RU-vid channel and your paid subscription on your website?
@bonle3771
@bonle3771 8 месяцев назад
gaw damnn 3 hrs for 2d dp
@adityavikramsinha408
@adityavikramsinha408 5 месяцев назад
godly
@piyush1342
@piyush1342 Год назад
I am the winner today
@deathbombs
@deathbombs Год назад
Naisu
@saiadigoppula3599
@saiadigoppula3599 Год назад
LeetCode 638 explanation plz
@saminhasan87
@saminhasan87 5 месяцев назад
Got TLE for burst balloons
@saminhasan87
@saminhasan87 5 месяцев назад
in C++, got TLE while using map for caching. Got accepted by using vector for caching
@MrKB_SSJ2
@MrKB_SSJ2 10 месяцев назад
1:38:00
@mybuddy11
@mybuddy11 Год назад
Could you please publish greedy algorithms full course lecture?
@dheeraj2729
@dheeraj2729 Год назад
If you keep all premium content here then what is the use of buying premium. I didnt get. But thanks as it is helpful for people who cant afford like me
@cyberserker
@cyberserker Год назад
These questions are from 150 LC list , even his normal videos feel really premium :D
@NeetCode
@NeetCode Год назад
These solutions are already available for free, I just compiled them into one video
@dheeraj2729
@dheeraj2729 Год назад
@@NeetCode ohh thanks for your reply☺☺
@dheeraj2729
@dheeraj2729 Год назад
@@cyberserker yes because of him i am able to solve problems. We all need teachers like him at some point in our life
@AryanSingh-eq2jv
@AryanSingh-eq2jv Год назад
```py class Solution: def longestCommonSubsequence(self, text1: str, text2: str) -> int: dp=[0]*(len(text1)+1) for i in text2: flag = 0 for j in range(len(text1)): if i==text1[j] and flag == 0: if dp[j+1]!=dp[j]+1: flag=1 dp[j+1]=dp[j]+1 else: if dp[j+1]>=dp[j]: flag=0 else: dp[j+1]=dp[j] return dp[-1] ``` I solved it in O(n) space complexity, beats 99% of the code in both time and memory distribution on leetcode
@AryanSingh-eq2jv
@AryanSingh-eq2jv Год назад
If you want me to explain let me know
@qwoijzacxoi
@qwoijzacxoi Год назад
first!!!! i am the first
@RandomShowerThoughts
@RandomShowerThoughts Год назад
this is so god damn complicated wtf
@audhil
@audhil Год назад
Superb!
@user-ps1vq2kw8h
@user-ps1vq2kw8h Год назад
Many thanks
@nikhil199029
@nikhil199029 Год назад
@neetcode, are u left handed?
@MrKB_SSJ2
@MrKB_SSJ2 10 месяцев назад
1:04:00
Далее
I quit Amazon after two months
10:09
Просмотров 572 тыс.
42. Trapping Rain Water
4:59
Просмотров 204
Big-O Notation - For Coding Interviews
20:38
Просмотров 415 тыс.
Dynamic Programming 1D - Full Course - Python
2:59:19
Просмотров 231 тыс.
iOS 18 vs Samsung, Xiaomi,Tecno, Android
0:54
Просмотров 67 тыс.
iPhone 16 - КРУТЕЙШИЕ ИННОВАЦИИ
4:50