this is a complex explanation usually if a tutor explains in a complex way i dry run by myself to understand what he is saying but in this video i have to rewatch some of the section again and again to understand
Aryan Mittal read it positively please => you are under misconception that you are simplifying problem, but you are actually overexplaining everything which is actually harder to understand than it actually should. My suggestion => Try to focus on what i said and try to see that in your videos. You can explain to only those actually don't need explanations, that's where comes tricky part that if someone already know intution then he will think that you are explaining very good, and if he doesn't know approach then he will think that he himself need to improve because of your over justifying things, rather you should just simplify problem to everyone like it force them to think that actually problem was too easy, that's where youtubers like Striver, Love babbar, CodeWithHarry , chai aur code , etc, shines and you do not even come close to them.
What I was thinking in first at the time of contest is using recursive with memoization and it is good to go and solved both Q2 & Q3 but when I used memoization it gives memory limit exceed error i both the cases and My submission is left with just last 10 cases in both the Questions and due to that I was stuck on these Questions in my whole leetcode contest and that actually ruined/fucked up my mind totally. My question is that to you Aryan that how we should think out like these approaches at the time of contest because in my mind apart from memoization no other approached come .
12:08 don't explain code we are not machines, explain approach with dry runs, and please take it positively and you will shine on youtube in the world of coding.
My memoization java code runs -> class Solution { int dp[][]; int kk; public int maximumLength(int[] nums, int k) { int n = nums.length; kk = k; dp = new int[n+1][k+1]; for (int[] d1 : dp) { Arrays.fill(d1, -1);
} int ans = 0; for(int i=n-1; i>0; i--){ for(int j=i-1; j>-1; j--){ ans = Math.max(ans , 2 + solve(nums , j , (nums[j] + nums[i]) % kk)); //finding first two elements. } } return ans; } public int solve(int[] nums, int pre, int mod) { if (pre == -1) return 0; if (dp[pre][mod] != -1) return dp[pre][mod]; int ans = 0; for (int i = pre-1; i >= 0; i--) { if ((nums[i] + nums[pre]) % kk == mod) { ans = Math.max(ans, 1 + solve(nums, i, mod)); break; } } dp[pre][mod] = ans; return ans; } }
@@Jazzimus I checked it already in morning but unfortunately I thought it is only hint so I didn't click on it and I couldn't see the video link. Thanks .
i also tried the recursive memoize approach TC-> O(k^2 *n) and i got MLE.
not understood
this is a complex explanation usually if a tutor explains in a complex way i dry run by myself to understand what he is saying but in this video i have to rewatch some of the section again and again to understand
true
Aryan Mittal read it positively please => you are under misconception that you are simplifying problem, but you are actually overexplaining everything which is actually harder to understand than it actually should.
My suggestion => Try to focus on what i said and try to see that in your videos. You can explain to only those actually don't need explanations, that's where comes tricky part that if someone already know intution then he will think that you are explaining very good, and if he doesn't know approach then he will think that he himself need to improve because of your over justifying things, rather you should just simplify problem to everyone like it force them to think that actually problem was too easy, that's where youtubers like Striver, Love babbar, CodeWithHarry , chai aur code , etc, shines and you do not even come close to them.
true bro
agree. from iiit bhagalpur right?
@@satyamraj2779 true !
This solution is incredible! good work!
i cant understand 🥲
even i can't
What I was thinking in first at the time of contest is using recursive with memoization and it is good to go and solved both Q2 & Q3 but when I used memoization it gives memory limit exceed error i both the cases and My submission is left with just last 10 cases in both the Questions and due to that I was stuck on these Questions in my whole leetcode contest and that actually ruined/fucked up my mind totally. My question is that to you Aryan that how we should think out like these approaches at the time of contest because in my mind apart from memoization no other approached come .
He is been doing this for many years now. It's all about consistent practice and evolving yourself with different approaches
@@sanketchugh294 Thank you I didn't know this before.
12:08 don't explain code we are not machines, explain approach with dry runs, and please take it positively and you will shine on youtube in the world of coding.
aryan cant understand this, idk why, first the first time feeling very bad
great video Aryan
Bhai 1st wali bhi thodi tricky thi
My memoization java code runs ->
class Solution {
int dp[][];
int kk;
public int maximumLength(int[] nums, int k) {
int n = nums.length;
kk = k;
dp = new int[n+1][k+1];
for (int[] d1 : dp) {
Arrays.fill(d1, -1);
}
int ans = 0;
for(int i=n-1; i>0; i--){
for(int j=i-1; j>-1; j--){
ans = Math.max(ans , 2 + solve(nums , j , (nums[j] + nums[i]) % kk)); //finding first two elements.
}
}
return ans;
}
public int solve(int[] nums, int pre, int mod) {
if (pre == -1) return 0;
if (dp[pre][mod] != -1) return dp[pre][mod];
int ans = 0;
for (int i = pre-1; i >= 0; i--) {
if ((nums[i] + nums[pre]) % kk == mod) {
ans = Math.max(ans, 1 + solve(nums, i, mod));
break;
}
}
dp[pre][mod] = ans;
return ans;
}
}
suggestion if possible remove top down section as it is so much confusing rest other is awesome
completely disagree, it's for the intuition
Bhai hindi me bol liya kro nhi dekhra koi bahr ka tume vo discussion section se samajh kete ha
true bhai...
Today's problem to upload karo jaldi
Remove Graph edges
check their community post
@@Jazzimus
I checked it already in morning but unfortunately I thought it is only hint so I didn't click on it and I couldn't see the video link.
Thanks .
🫡
First why r u elaborating all the stuffs which is very much irritating secondly u r teaching to graduate student not a kg school child
Not everyone watching is a graduate student
dude if see his hard problem explanation he make them look damn easy by this style and skip the simple part i usually do that and watch at 1.5-1.75.
Bro please accept my connection request !!
optimization of 3202 freezed my brain
true
Bro please accept my connection request !!
Bro full name to bata dete🥲, how will i search just Shashank ❤️