Комментарии:
Thank you!
Ответитьis 2d array dp and pointer approach the same time complexity?
ОтветитьEdit Distance: What if we have fourth option is exchange two adjacent character?
ОтветитьLoved it thanks for the amazing explanations❤
Ответить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]
```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
@neetcode, are u left handed?
ОтветитьThanks lots for putting together this rich resource.
Ответитьthis is so god damn complicated wtf
Ответитьnice good neatcode :)
Ответить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
ОтветитьPlease do more videos on frequently asked questions in Maang interviews on leetcode.
Ответить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.
ОтветитьThanks man .
ОтветитьThanks!
ОтветитьNaisu
ОтветитьPlease make video in dynamic programming in Java
ОтветитьChristmas came early!
Ответить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.
Ответитьtypo in the problem Distinct subsequences. It should be dfs(i+1,j) instead of dfs(i+i,j) in line 14 and 16
Ответить32. Longest Valid Parentheses can you solve this please?
Ответить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.
ОтветитьLeetCode 638 explanation plz
Ответить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!
This is insane! Thank you so much
Ответить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!
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
ОтветитьHi, please make a lecture on LC 1626. Best Team With No Conflicts! Love your way of teaching!!
ОтветитьHey neetcode please solve the problem no 1478 of leetcode largest continuous subaaray with abs diff les than limit
ОтветитьHey could you please make a video on LC problem number 273
Ответить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.
ОтветитьHave you thought about adding Swift language solutions on your website?
ОтветитьIf I learn something from this video, I’m definitely signing up for lifetime access
ОтветитьBest coding channel. End of
ОтветитьHi Bro.Please do a full course on graph problems .It would be really helpful.This video is awesome 👌
Ответитьliterally you are the only one that i can complete his video without being bored
ОтветитьShortest Path in Binary Matrix can you please solve this question leetcode 1091
ОтветитьYour explanation is better than anything i have see online
ОтветитьCould you please publish greedy algorithms full course lecture?
Ответить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.
Yeah baby.❤
Ответитьthanx man , when will be the system design course coming ?
Ответить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
ОтветитьMan this guy is awesome
Ответить