By my experience some problems shouldn’t be understood by dry run & this is one such problem. (Apart from suffixMax portion, which can be understood by dry run) This problem involved “how to reach” & “why to use” a specific technique, if you have watched video maximum twice & had a copy pen with you while i was explaining, & still this isn’t understandable, then i might recommend solving more dp medium problems first (apart from those so called sheet problems)
I see that you tried really hard, to explaining this. But the problem itself is very confusing :X. I'll watch this video later a couple of times to see if I can understand.
I am trying to do this using recursive solution, can someone help me check why my logic is wrong? class Solution { public: int findSubSeq(vector& nums, int curr, int prev, int diff){ if(curr>=nums.size()) return 0; int take=0, leave=0, neww=0; leave = findSubSeq(nums, curr+1, prev, diff); if(prev!=-1 && nums[curr]-nums[prev]
Check with this.. But don't submit unless you want to choke leetcode servers on memory and get slapped in return.. class Solution { int solve(int idx, int diff, int last_ele_idx, vector& nums, vector& dp){ if(idx == nums.size()) return 0; if(dp[idx][diff][last_ele_idx] != -1) return dp[idx][diff][last_ele_idx]; int ans = 0; if(abs(nums[idx] - nums[last_ele_idx])
Short - ruclips.net/user/shorts_Gb8CiwqdsY?feature=share
Can you tell similar questions to this?
I miss the days when I could solve the medium probs real quick, lately most of them feel super hard. :o
same bro
Couldn't follow tbh. Need less explaining and more dry running of a small simple example.
By my experience some problems shouldn’t be understood by dry run & this is one such problem. (Apart from suffixMax portion, which can be understood by dry run)
This problem involved “how to reach” & “why to use” a specific technique, if you have watched video maximum twice & had a copy pen with you while i was explaining, & still this isn’t understandable, then i might recommend solving more dp medium problems first (apart from those so called sheet problems)
Genius, just genius....I understood the solution but after watching twice. But it would be really great if you would include dry running on a sample
good morning welcome back....at night 11:30 anyways thanks for upload
🤣🤣
Finally it's here!! ❤❤
Shubham bhai ❤🔥
Hey u know me?? 😅❤❤@@ARYANMITTAL
best video like always
Will this question be easy with push dp than pull dp?
thanks man, really great effort.
I was doing inTC= length of Array*300*300
I see that you tried really hard, to explaining this. But the problem itself is very confusing :X.
I'll watch this video later a couple of times to see if I can understand.
watched almost 5 times 😃😃
Could you please explain the 4th one,cause this only question is challenging
🔥🔥
I am trying to do this using recursive solution, can someone help me check why my logic is wrong?
class Solution {
public:
int findSubSeq(vector& nums, int curr, int prev, int diff){
if(curr>=nums.size()) return 0;
int take=0, leave=0, neww=0;
leave = findSubSeq(nums, curr+1, prev, diff);
if(prev!=-1 && nums[curr]-nums[prev]
Check with this.. But don't submit unless you want to choke leetcode servers on memory and get slapped in return..
class Solution {
int solve(int idx, int diff, int last_ele_idx, vector& nums, vector& dp){
if(idx == nums.size()) return 0;
if(dp[idx][diff][last_ele_idx] != -1) return dp[idx][diff][last_ele_idx];
int ans = 0;
if(abs(nums[idx] - nums[last_ele_idx])
i have a doubt isnt 1e8 works under time limit ..?? , btw nice editorial
no it doesn't, it only works till 1e5
🥰🥰🥰🥰
🥰🥰🥰🥰🥰🥰🥰
Bhai recursion wala code bhi bata do sarh mai
Bhai full video dekho pata chal jaaega, why top down is super tricky here & bottom up much simpler🫂
🔥🔥🔥