Solving Questions With Brainpower | GOOGLE | Leetcode-2140 | Live Code + Explanation

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

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 45
@akki8534
@akki8534 Жыл бұрын
I am your follower from when you had 33subs and at that i was unable distinguish wheather the given problem is of Dp or not.......but now i am able to solve any dp problem within 5 mins using recursion and memoisation......Thanku ❤❤ 🔴🔴Request :- Please make a single video on Tabulation method of Dp.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much. Made my day. Sure, separate video for tabulation will be done from next time onwards ❤️❤️❤️
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
I joined this channel when it had around ~80 subs. I can't believe today I can solve Graph Qns and DP Qns too. Which seemed like a nightmare. Thanks to this masterpiece
@AbhijeetMuneshwar
@AbhijeetMuneshwar 4 ай бұрын
Respected MIK Sir, I solved this question by recursion & recursion + memorization on my own. Feeling proud as I could do it & also Feeling humble 🙇, because all credit goes to you. 🙏 Next target is to work on Bottom Up approach. 🎯
@oqant0424
@oqant0424 Жыл бұрын
for the first time ever i solved a dp question with recur + memo on my own ................all credit goes to u bhaiya❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so so much ❤️ It gives me immense pleasure seeing such comments
@GB-su9gu
@GB-su9gu 2 ай бұрын
after questions, i am able to identify Dp, write down recursive tree yourself, code recursion.❤ great sir
@rahulmaurya6451
@rahulmaurya6451 Жыл бұрын
Bhaiya aaj maine phli baar DP ka ques bina apki video dekhe apne se solve kiya,,, yeh sb bss apke wajah se possible ho paya,, maine abhi tk officially DP nhi pdha h but roj POTD krte krte or apki video dekhte dekhte DP sikh gya hu,, Thanks a lot bhaiya 🙇🙏,, Agr aap consistently video n daalte toh mai kuch n Sikh pata
@oqant0424
@oqant0424 Жыл бұрын
same here
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Rahul. Your comment made my day ❤️❤️❤️
@nileshdeshmukh7841
@nileshdeshmukh7841 Жыл бұрын
This is my first DP question which I solved by Myself through Memoization ,but for tabulation check your video , yes I understood
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so so much ❤️ It gives me immense pleasure seeing such comments
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
You are the best tutor I have found DS/Algo (especially for DP and Graphs)
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
I have started to see the growth in me in solving DP problems. Thanks to you sir
@AYJ959
@AYJ959 Жыл бұрын
thank you solved it in 5 min with rec + memo
@Piyushraj0
@Piyushraj0 Жыл бұрын
Khud se kr liya aaj ka question rec se memo thank you. Knapsack dp clear ho rhi. ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Awesome ❤️❤️
@kaushikdutta2666
@kaushikdutta2666 Жыл бұрын
You explain in such a great way. I've seen so many videos but yours is definitely great. Keep it up. Keep Going ♥
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much Kaushik ❤️❤️
@codeandtalk6
@codeandtalk6 Жыл бұрын
I solved it within 10 min thank you brother ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Awesome ❤️❤️❤️
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
wow 10 minutes
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
wow
@ugcwithaddi
@ugcwithaddi Жыл бұрын
Learning a lot from this channel
@shabananoor9423
@shabananoor9423 Жыл бұрын
Amazing Explanation
@JJ-tp2dd
@JJ-tp2dd Жыл бұрын
Thanks bhai. Java Implementation: Rec + Memo class Solution { private int n; private long solve(int[][] q, long[] dp, int idx) { if(idx >= n) { return 0; } if(dp[idx] != -1) { return dp[idx]; } long take = q[idx][0] + solve(q,dp,idx+q[idx][1]+1); long notTake = 0 + solve(q,dp,idx+1); return dp[idx] = Math.max(take, notTake); } public long mostPoints(int[][] questions) { this.n = questions.length; long dp[] = new long[n+1]; Arrays.fill(dp, -1); return solve(questions,dp,0); } } ******************************************************************* Bottom up: class Solution { public long mostPoints(int[][] questions) { int n = questions.length; if(n == 1){ return questions[0][0]; } long[] dp = new long[200001]; //dp[i] --> max points gained by Qns from i to n-1 for(int i=n-1; i>=0; i--) { dp[i] = Math.max(questions[i][0] + dp[i + questions[i][1] + 1], dp[i+1]) ; } return dp[0]; } }
@codestorywithMIK
@codestorywithMIK Жыл бұрын
❤️
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
Thanks
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Thanks man
@anuppatankar4294
@anuppatankar4294 Жыл бұрын
Great Video ❤
@thekindspill
@thekindspill Жыл бұрын
Crystal clear ⭐
@AlishaKhan-ww3io
@AlishaKhan-ww3io Жыл бұрын
One of the best
@UmeshBisht-ik4li
@UmeshBisht-ik4li Жыл бұрын
Thanku bhaiya for the explanation ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Umesh for watching ❤️❤️❤️
@codeandtalk6
@codeandtalk6 Жыл бұрын
@bobo_v
@bobo_v Жыл бұрын
bro if i came up with a memo solution will interviewer be satisfy or not? or what will happen if i am not able to optimize code to tabulation or space optimization please reply
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Hey, Actually they expect you to solve from brute force first. The they will ask can you further optimise, then mention about recur memo. Sometimes they skip to next qn if there is not much time, but if solved recur memo quick and they have time, they will definitely ask for optimisation to bottom up
@ManojKrVerma-vw4dx
@ManojKrVerma-vw4dx Жыл бұрын
could solve by myself...
@codestorywithMIK
@codestorywithMIK Жыл бұрын
❤️❤️
@yatri6329
@yatri6329 Жыл бұрын
Aaj recursion wala v nhi hua, mere se
@codestorywithMIK
@codestorywithMIK Жыл бұрын
That’s totally fine. Do not worry. Would you like to share where exactly you got stuck ?
@yatri6329
@yatri6329 Жыл бұрын
@@codestorywithMIK I had idea of going with decision like pick and non pick. Once I pick then i was not increasing the index with collection[0][1]+1. Ye idea mujhe lag nhi rha tha non pick was fine
@satyamshukla2389
@satyamshukla2389 Жыл бұрын
bhaiya I did recursion + memo on my own. I love your videos. Can we connect on instagram. You are the best teaher. The way you speak and explain ❤‍🔥
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so so much ❤️ It gives me immense pleasure seeing such comments
@codestorywithMIK
@codestorywithMIK Жыл бұрын
This is my Instagram link - instagram.com/codestorywithmik?igshid=MzRlODBiNWFlZA==
Scramble String - (GOOGLE) | Leetcode-87 | Explanation ➕ Live Coding
34:36
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 34 МЛН
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 12 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 269 #shorts
00:26
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 125 МЛН
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 150 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 664 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 34 МЛН