Bhai Jaisa Graph Series ko Scratch se padhaya waise hi please ek Tree series bhi bana do na and Ryan ki baate include karna bilkul mat bhulna, usse energy level maintain rehta hai!! Thank you for the Graph series... Kaafi underrated content hai and ye channel bhi❤
class Solution { public: int loww, highh, zeroo, onee; int dp[100005]; int mod = 1e9+7; int rec(int len){ //base case if(len>highh)return 0; int count = 0; if(len>=loww && len
really looking forward to your dp concepts series. Ek suggestion/request h.. Jb ap concepts smjhaoge dp series me and then us concept pe question karaoge toh please 9-10 similar pattern k question link kr dena ya question no comment me dena so that practice ho paye..🥺🥺
Bro, will there be a situation where the interviewer specifically asks for bottom up approach? Is this just to know another approach apart from top down and or does this have any added advantage? Because somehow I feel top down approach is more intuitive than the bottom up.
Bhaiya jbb ham t[0] = 1 le rhe hai means zero length kitni good strings to it show have followed naa ki uski len mtlb zero low aur high ke bich ho tbb hi apn t[0] kr skte hai??
Sir waise toh mai samajh gaya aap ka bottom-up karne ka method. But maine ye code likha tha khud se when i saw this question, kya hum isko kuch karke convert kar sakte hai iterative dp mein? class Solution { public: const int mod = 1e9 + 7; int low, high, zero, one; int dp[100010]; int solve(int sz) { if (sz > high) return 0; if (dp[sz] != -1) return dp[sz]; int cnt = 0; if (low high = high; this->zero = zero; this->one = one; memset(dp, -1, sizeof(dp)); return solve(0); } };
Actually if you remember I told that if we set t[0] = 1 Then whole array will be 0 till the end. Sometimes there are questions where we do something like this. One similar Qn is Minumum Subset Sum in DP bottom up. I will be starting DP concepts playlist where I will be teaching all these things too
@@codestorywithMIK sir please start asap in 2-3 months we will be having our placement month so it will be very kind of you if you start soon , because there are small concepts like this which we lack and are unable to solve problems
Hi Yash, Actually i am spending most of my time today with my mom celebrating Mother’s. I will definitely come up with the video soon for that. Thank you for trusting my channel and the patience ❤️❤️
can anyone help me to debug this code ?? class Solution { int mod = 1000000007; public int countGoodStrings(int low, int high, int zero, int one) { int[] dp = new int[high+1]; Arrays.fill(dp,0); dp[0] = 1;
for(int i = 1;i= 0) ? dp[i-zero] : 0; int foro = ((i-one) >= 0) ? dp[i-one] : 0; dp[i] = forz%mod + foro%mod; } int ans = 0 ; for(int i = low ;i
Just unbelievable bhai..magical ♥💙 . Java implementation:
class Solution {
public int countGoodStrings(int low, int high, int zero, int one) {
int mod = 1000000007;
//t[i] == number of good strings of length i
int [] t = new int[high+1];
t[0] = 1; // ""
for(int i=1; i= 0)
t[i] = (t[i]%mod + t[i-zero]%mod)%mod;
if(i-one >=0)
t[i] = (t[i]%mod + t[i-one]%mod)%mod;
}
int ans = 0;
for(int l=low; l
❤️❤️
Mik bhai aap bohot sahi ho sachi me matlb kya bolne ka itna mast samjate ho
Bhai Jaisa Graph Series ko Scratch se padhaya waise hi please ek Tree series bhi bana do na and Ryan ki baate include karna bilkul mat bhulna, usse energy level maintain rehta hai!!
Thank you for the Graph series... Kaafi underrated content hai and ye channel bhi❤
Sure Suraj
Thank you so much for watching ❤️❤️❤️
For Viewers - switch to 1.5x for better experience!
Thank you ❤️😇🙏
class Solution {
public:
int loww, highh, zeroo, onee;
int dp[100005];
int mod = 1e9+7;
int rec(int len){
//base case
if(len>highh)return 0;
int count = 0;
if(len>=loww && len
sir you are not a teacher you are absolute magician!! .....sir aap kha rahte ho ye bataoge kabhi aan hua to milne jarur aaunga, please sir!!
really looking forward to your dp concepts series. Ek suggestion/request h.. Jb ap concepts smjhaoge dp series me and then us concept pe question karaoge toh please 9-10 similar pattern k question link kr dena ya question no comment me dena so that practice ho paye..🥺🥺
Sure thing ❤️❤️
Bro, will there be a situation where the interviewer specifically asks for bottom up approach?
Is this just to know another approach apart from top down and or does this have any added advantage?
Because somehow I feel top down approach is more intuitive than the bottom up.
Bhaiya jbb ham t[0] = 1 le rhe hai means zero length kitni good strings to it show have followed naa ki uski len mtlb zero low aur high ke bich ho tbb hi apn t[0] kr skte hai??
Sir waise toh mai samajh gaya aap ka bottom-up karne ka method.
But maine ye code likha tha khud se when i saw this question, kya hum isko kuch karke convert kar sakte hai iterative dp mein?
class Solution {
public:
const int mod = 1e9 + 7;
int low, high, zero, one;
int dp[100010];
int solve(int sz) {
if (sz > high)
return 0;
if (dp[sz] != -1)
return dp[sz];
int cnt = 0;
if (low high = high;
this->zero = zero;
this->one = one;
memset(dp, -1, sizeof(dp));
return solve(0);
}
};
Bhaiya In interviews Top-down (recur+memo) is sufficient or we need to practice Bottom up as well?
Bottom up has been increasingly become important for interviews of Top tech companies.
L.E.G.E.N.D
First if case mei rvalue mei t[i] ki need kya hain?
you can skip it since it’s the first if condition.
Supper
❤
sir i have one simple doubt aap empty string ko as a good string count kr rahe jaise t[0]=1 toh t[1]=2 hona chaiye us logic se please clear this doubt
Actually if you remember I told that if we set t[0] = 1
Then whole array will be 0 till the end.
Sometimes there are questions where we do something like this.
One similar Qn is Minumum Subset Sum in DP bottom up.
I will be starting DP concepts playlist where I will be teaching all these things too
@@codestorywithMIK sir please start asap in 2-3 months we will be having our placement month so it will be very kind of you if you start soon , because there are small concepts like this which we lack and are unable to solve problems
Sure thing ❤️❤️
Dude, when do you rest ? Weekends (I don't think so)
Coders never rest. Its a habit not compulsion
@@ManojKrVerma-vw4dx True
Bhaiya plz 1 request next aaj 1 video upload kr do on today biweekly leetcode contest 3 question maximum xor
Hi Yash,
Actually i am spending most of my time today with my mom celebrating Mother’s.
I will definitely come up with the video soon for that. Thank you for trusting my channel and the patience ❤️❤️
can anyone help me to debug this code ??
class Solution {
int mod = 1000000007;
public int countGoodStrings(int low, int high, int zero, int one) {
int[] dp = new int[high+1];
Arrays.fill(dp,0);
dp[0] = 1;
for(int i = 1;i= 0) ? dp[i-zero] : 0;
int foro = ((i-one) >= 0) ? dp[i-one] : 0;
dp[i] = forz%mod + foro%mod;
}
int ans = 0 ;
for(int i = low ;i
ask chatgpt