3418. Maximum Amount of Money Robot Can Earn | DP on Grids | Top Down Approach

  Рет қаралды 2,109

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 3418. Maximum Amount of Money Robot Can Earn | DP on Grids | Top Down Approach
DP on Grid1 - • Number of Increasing P...
DP on Grid2 - • 3393. Count Paths With...
CODE - CODE - leetcode.com/p...
Let's Connect:
X Twitter : x.com/aryan_mi...
📱Discord (Join Community) : / discord
📝Linkedin (About me): / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
📱Telegram : t.me/aryan_mit...
🤖 Github: github.com/ary...
✨ Timelines✨
0:00 - Problem Explanation
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 23
@kbcoder3734
@kbcoder3734 25 күн бұрын
Superb solution, I spent more than 1 hour on this problem during the contest while using 2-d DP.
@harshbhardwaj8112
@harshbhardwaj8112 24 күн бұрын
Same here
@shauryatomer1058
@shauryatomer1058 25 күн бұрын
thanks for the great explanation, was able to come with complete solution, only thing left was didn't think separate base case would be required for i = m - 1 && j = n - 1.
@DarkDragon-bz6qp
@DarkDragon-bz6qp 25 күн бұрын
Thanks Great explanation..For interviews if i explain till memoization will it be enough?or i need to use bottom up approach?
@25-cse-csmohitkumarmandal59
@25-cse-csmohitkumarmandal59 24 күн бұрын
If you able to solve memorization, you will able to solve bottom up already (once watch Love Babbar 's DP series) (If q. Is easy-moderate)
@DarkDragon-bz6qp
@DarkDragon-bz6qp 24 күн бұрын
​@@25-cse-csmohitkumarmandal59okk
@whyyshivam
@whyyshivam 25 күн бұрын
Another approach I thought of is : Calculate the total sum from (0,0) till (m−1,n−1), including negative values. During the traversal, track the two smallest (most negative) values. In the final answer, add the absolute values of these two smallest negatives to the total sum. Is this approach correct?
@kumkumslab5811
@kumkumslab5811 22 күн бұрын
no because you can't track which path you have selected so might be possible that 2 min elements are not the part of that path
@Its_Shubham_Negi
@Its_Shubham_Negi 25 күн бұрын
Thanks ❤
@aryavyadav9345
@aryavyadav9345 24 күн бұрын
Was able to solve this question during the contest thankfully 😊
@NeelakshiSachdeva
@NeelakshiSachdeva 23 күн бұрын
Can I do dp without doing recursion?? Actually somebody told me to do recursion first as dp follows but even after spending 2 weeks I'm not getting recursion totally. Can u pls guide if dp can be done independently.or not?
@aryavyadav9345
@aryavyadav9345 21 күн бұрын
@@NeelakshiSachdeva DP can be done without recursion, that method is called tabulation where loops are involved. However, I highly suggest you to follow through learning recursion. Try doing striver's SDE sheet's recursion questions and watch his vids on those questions. You can also check out Love Babbar's C++ course. Recursion is very important as it has applications in higher data structures like trees and graphs. Also , an update now that the rating has been updated on leetcode. It turns out leetcode rejected my solution on this question since it gave TLE on the 577 test case.
@kodurisaivishnu4916
@kodurisaivishnu4916 24 күн бұрын
i have got an idea to solve this problem but ,Failed to handle the Base case. Does AnyOne With same problem ?
@BruceWayne-lm6xt
@BruceWayne-lm6xt 24 күн бұрын
yes me toooo
@dipanshubose-u9b
@dipanshubose-u9b 23 күн бұрын
Yeah just forgot the case where theres is a robber at the destination cell
@nikhilprakash729
@nikhilprakash729 25 күн бұрын
nice..
@KedarBhawthankar
@KedarBhawthankar 23 күн бұрын
you explain very well but i dont understand
@DarkDragon-bz6qp
@DarkDragon-bz6qp 25 күн бұрын
Found this question tough
@kbcoder3734
@kbcoder3734 25 күн бұрын
Same
@staywithmeforever
@staywithmeforever 19 күн бұрын
Atmost 2 cells is the worse
3429. Paint House IV | 2 Way DP | Top Down DP
18:24
Aryan Mittal
Рет қаралды 2 М.
3443. Maximum Manhattan Distance After K Changes | Greedy
13:24
Aryan Mittal
Рет қаралды 2,4 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 209 М.
2429. Minimize XOR | Bit Manipulation
13:52
Aryan Mittal
Рет қаралды 2,4 М.
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 326 М.
Как наука победила религию
17:02
zig will change programming forever
9:34
Low Level
Рет қаралды 413 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
8 Data Structures Every Programmer Should Know
17:09
ForrestKnight
Рет қаралды 273 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН