Cherry Pickup II - Leetcode 1463 - Python

  Рет қаралды 16,984

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 32
@PabloElBlanco
@PabloElBlanco 9 ай бұрын
This is a certified Neetcode classic. thanks for continuing my streak 💯
@squid84202
@squid84202 9 ай бұрын
I'm trying to learn DP and every time I come across a daily problem with DP I watch your videos. I just want to say I appreciate you showing us the top down approach instead of going straight into using tabulation. It's more effort but it is appreciated.
@chrisnieves3881
@chrisnieves3881 9 ай бұрын
Amazon intern interview thursday pray for me mr neetcode please
@NeetCodeIO
@NeetCodeIO 9 ай бұрын
You got this!!! 💪
@peachpink2831
@peachpink2831 9 ай бұрын
Since we have a symmetric matrix we can optimize the final approach even more by operating on just top right and bottom left triangle matrix alternatively. This will reduce the memory by half but will take longer to write.
@BlunderArmour
@BlunderArmour 9 ай бұрын
Neato! I like your recursion to DP approach a lot. I got stuck at the DP solution when I tried to do it myself. But your video helps me understand how to develop the right way of thinking. Thank you!
@ishanpadalkar9072
@ishanpadalkar9072 9 ай бұрын
Gave up trying to understand the code for the second approach lol. Will return with a fresher mind.
@pastori2672
@pastori2672 9 ай бұрын
lost my sanity trying to get the dp solution
@PabloElBlanco
@PabloElBlanco 9 ай бұрын
neato btw, the hint leetcode gave scared me. also i can see why you consider this problem to be easier than cherry pickup 1, looks like a nightmare
@trihoang2863
@trihoang2863 9 ай бұрын
What a difficult problem. Thank you!
@Pegasus02Kr
@Pegasus02Kr 9 ай бұрын
me seeing Neetcode's recursive solutions: "I can pretty much do it alone!" me seeing Neetcode's tabulation solution: "Forget it, I can't"
@KnightMirkoYo
@KnightMirkoYo 9 ай бұрын
The memo approach fails with TLE in Java on the last test case, so I have to do DP and it's Sunday 😪 Thank you so much, couldn't do it without you.
@SAIGOVINDSATISH
@SAIGOVINDSATISH 9 ай бұрын
Nope it passes
@KnightMirkoYo
@KnightMirkoYo 9 ай бұрын
@@SAIGOVINDSATISH yeah, I had a bug which caused my memo array to do nothing. Now it's alright :)
@SAIGOVINDSATISH
@SAIGOVINDSATISH 9 ай бұрын
Can you please post video solutions of weekly contests it will be really helpful to understand those problems which we aren't able to solve .By seeing your videos we can easly upsolve the problem using initial hints during first half of the video
@AmirDhahri-rn3cg
@AmirDhahri-rn3cg 4 ай бұрын
Thank you so much ❤❤❤
@sdemji
@sdemji 9 ай бұрын
would it work to take the maximum cost route, remove it, then take the new maximum route again ? short answer : nope
@VijaySharma-nu5lz
@VijaySharma-nu5lz 9 ай бұрын
In the memoization approach(1st approach), can anyone tell me how to print the path of individual robots as well along with returning the results? Thanks.
@吳倩怡男朋友
@吳倩怡男朋友 9 ай бұрын
keeping a prev[][] matrix may help
@dingus2332
@dingus2332 9 ай бұрын
ah man , this was solvable , I just jumped to seeing the solution
@jiteshpahwa266
@jiteshpahwa266 9 ай бұрын
Great explanation !! Thankyou :)
@andrewqian9029
@andrewqian9029 9 ай бұрын
Neetcode if you can here me, please save me. I have interview tmrw morning, please lend me ur strength
@카이트-c8y
@카이트-c8y 9 ай бұрын
Why it should return 0 if c1 and c2 is same, instead of return maximum values from dfs(r+1, all possible column) ?
@NeetCodeIO
@NeetCodeIO 9 ай бұрын
We dont need to ever consider the case where c1 and c2 are the same, because it will never lead to the maximal result. I gave a short summary of why, it's basically a proof by contradiction.
@karthikb547
@karthikb547 5 ай бұрын
Thanks man :)
@aazzrwadrf
@aazzrwadrf 9 ай бұрын
this was the first hard i solved
@krateskim4169
@krateskim4169 9 ай бұрын
Thank you neato
@kirillzlobin7135
@kirillzlobin7135 9 ай бұрын
Leetcode 2267 Would be interesting to solve. Please please please
@카이트-c8y
@카이트-c8y 9 ай бұрын
Why it should return 0 if c1 and c2 is same, instead of return arr[r][c1] + 0 + maximum values from dfs(r+1, all possible column) ?
@clouds_304
@clouds_304 9 ай бұрын
I was wondering the same. But then i remembered he said in the beginning, the case where both robots land on zhe same grid will not be part of the best solution. So if it happens we just give up and return 0
@deathbombs
@deathbombs 9 ай бұрын
I got this in first submission lol
@parikxit
@parikxit 9 ай бұрын
neat
Meeting Rooms III - Leetcode 2402 - Python
16:16
NeetCodeIO
Рет қаралды 22 М.
Minimum Cost to Hire K Workers - Leetcode 857 - Python
19:01
NeetCodeIO
Рет қаралды 15 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 46 МЛН
I was just passing by
00:10
Artem Ivashin
Рет қаралды 18 МЛН
Freedom Trail - Leetcode 514 - Python
25:18
NeetCodeIO
Рет қаралды 14 М.
int main(){} to game
Nathan Baggs
Рет қаралды 84
Codeforces CodeTON Round 9 Animated Video Editorial [A-D]
14:59
Bora Demirtas
Рет қаралды 1,1 М.
Greatest Common Divisor Traversal - Leetcode 2709 - Python
24:30
Student Attendance Record II - Leetcode 552 - Python
27:10
NeetCodeIO
Рет қаралды 9 М.
Minimum Time to Visit a Cell In a Grid - Leetcode 2577 - Python
22:55
K Inverse Pairs Array - Leetcode 629 - Python
29:44
NeetCodeIO
Рет қаралды 16 М.
Longest Ideal Subsequence - Leetcode 2370 - Python
28:02
NeetCodeIO
Рет қаралды 12 М.
Minimum Obstacle Removal to Reach Corner - Leetcode 2290 - Python
24:52
Partition Array for Maximum Sum - Leetcode 1043 - Python
27:33
NeetCodeIO
Рет қаралды 18 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН