🔥 Subscribe to coding75 Pro for Live Classes, 1:1 Mentorship Sessions: coding75.com/pro ✅ Live DSA Classes ✅ Codeforces, Codechef, Leetcode Live Discussion ✅ 1:1 Mock Interviews ✅ 1:1 Mentorship Sessions ✅ 1:1 Resume Review ✅ Live Weekly Project Building Sessions ✅ Live CS Fundamental Classes In case of any queries regarding coding75, WhatsApp us here: wa.me/message/TPN76XLWVOWDB1
First scenario: if(freq[i] != bits[i]) return false; Second Scenario: if(freq[i] > 0 and bits[i] == 0) return false; if(freq[i] == 0 and bits[i] > 0) return false; Both scenarios might work similar but why it is not working for this probelm??
when we apply binary search and sets low=mid+1 than there is a possibility that the k can be smaller than mid too but are we using the fact that the if k works then true for k+1 too?
if(freq[i]!=bits[i]) return false; karke q nahi check kar sakte??? why freq[i]>0&&bits[i]==0 return false; OR freq[i]==0&&bits[i]>0 return false; why these conditions?
because frequecy(count) of the number at particular index does not matter , the only thing matters in or operation is the avilabilty of bit. either it is set or not
Thanku bhaiya but To be honest you need to explain code bit more it is very confusing may be it may take some more extra time but this will help us a lot
Bro i'm feeling so dumb right now after seeing the solution for A. Thanks though I got the explanation of why sum/2 works, the testcase 3,4,5 gives the right answer 6 with this formula. I was stuck on the logic of this testcase for 2hrs yesterday
@@aisharawat9102 1) If there is something to find min/max in problem, try to think if binary search can happen. 2) So to check if search space is monotonic, I evaluated for k+1 window size.