This is lengthy just because I have added detailed and minute details for beginners. But if you got the idea in the middle, feel free to stop in the middle and try to code as per the understanding. Hope it helps ❤❤❤❤
@rugung13815 ай бұрын
please make a videos on this Qn bhaiya🙏 3181. Maximum Total Reward Using Operations II last LC contest ke DP optimisation ke hai
@aws_handles5 ай бұрын
Thanks a lot
@pranavvenkat79715 ай бұрын
Very detailed explanation really enjoyed keep uploading video daily ...your video daily reminder for me to learn DSA daily
@gui-codes5 ай бұрын
please keep posting such long and detailed videos. these are hidden gems. Thanks a lot
@anjanasahay21725 ай бұрын
Please keep on sharing new methods that will help us....with hard problems??? Especially the bitwise manipulation in the preSum types❤❤
@25-cse-csmohitkumarmandal595 ай бұрын
Eagerly waiting for this video ❤ thanks 🙏
@aws_handles5 ай бұрын
Itna detail paid course me bhi nai milta hoga thanks mik
@22gauravkumar705 ай бұрын
bhaiya please segment tree sikha do pls , 1 saal se try kr raha hun sikhne ka aap hi sikha skte ho. ek 3-4 ghnte ki video bna do , 5-6 questions krwa do along with basic code , please bhaiya
@molyoxide83585 ай бұрын
1st comment. Bro pls make a playlist on Bit-Manipulation
@Rajan-xv9cz5 ай бұрын
best explanation really enjoyed♥♥♥
@bidishadas8325 ай бұрын
Excellent explanation.
@shashiraj62265 ай бұрын
i tried to understand this question on many other channel but i could not get it. Thank you very much for this video and amazing explanation.💜
@pokeindia53615 ай бұрын
@shashiraj6226 is it contest q??
@shashiraj62265 ай бұрын
@@pokeindia5361 yes last question of leetcode contest 400
@jailudhani8841Ай бұрын
Is problem statement changed, Previously it was for AND, now I am seeing it is for OR.
@ugcwithaddi5 ай бұрын
Thanks a lot for detailing every point
@jeehub0415 ай бұрын
Superb explaination sir but itna sab contest me figure out karna mushkil hota
@codestorywithMIK5 ай бұрын
I agree but with practising problems like the more and more, we will be able to implement it during interviews/contests in given time frame ❤️
@mohd.vaseem74105 ай бұрын
amazing eleplanation
@tanmaykumar40815 ай бұрын
bhaiya ab please 2,3,4 problem no. of contest upload karna start kar dijiyega na every week it will be really helpful. If you could find time
@gauravbanerjee28985 ай бұрын
Thanks a lot bhaiya ❤❤
@rev_krakken705 ай бұрын
Hi @codestorywithMIK. I skimmed through some of the solutions with better time complexity, and some of them were using dp with hashset. Can you make one video of this same problem using that approach?
@ramankr00225 ай бұрын
Thank you
@dayashankarlakhotia49435 ай бұрын
Good explanation 👏 ❤
@ronniieeestar62745 ай бұрын
Hi @codestorywithMIK leetcode changed this question previously it is AND of subarray now it is OR of subarray
@iWontFakeIt5 ай бұрын
maine binary search + prefix sum se solve kiya tha contest k time pe, kyuki wahi mera dimag me chamka tha
@Lakshya-f4l2 ай бұрын
Can you explain the intuition behind your solution?
@thekindspill5 ай бұрын
Netflix ❌ MIK’s Long videos ✅
@English_Vinglish-c9o5 ай бұрын
@codestorywithMIK in brute force shouldnt the loop be from j=i instead of j=0?
@meme-ku1vs5 ай бұрын
thanks
@25-cse-csmohitkumarmandal595 ай бұрын
Mere brute force 806 kuch test case pass kiye the 😅
@pokeindia53615 ай бұрын
Ye contest ka q h kya??
@25-cse-csmohitkumarmandal595 ай бұрын
@@pokeindia5361 yes
@Sumit-wy4zp5 ай бұрын
Yes
@Ronakrewar4 ай бұрын
we can use map approch
@pokeindia53615 ай бұрын
Bhaiya longest valid parantheses q bataiye please..... Ye interview k liye bhi important h..... Please bhaiya
@Piyush-yp2po5 ай бұрын
What about nand? (& ~a)?
@HarshPal-i5i5 ай бұрын
hey can you provide your slide also ..... if it is possible
@shivam875S3 ай бұрын
code is giving wrong output plzz check it sir i think leetcode change the testcase
@aizad786iqbal5 ай бұрын
slack ke messages aa rahe hai :D
@GR8_Impact5 ай бұрын
Why this Question got changed from Leetcode to Bitwise OR ? I was thinking why the code is not working 😁 Modified code for Bitwise OR class Solution { public: void updateFreq(int op, int val, int* freqBits) { int i = 0; while (val > 0) { if ((val & 1)) { freqBits[i] += op; } val >>= 1; i++; } } int minimumDifference(vector& nums, int k) { ios_base::sync_with_stdio(false); int freqBits[32] = {0}; int n = nums.size(); int i = 0; int j = 0; int windowOR = 0; int result = INT_MAX; while (j < n) { windowOR = windowOR | nums[j]; updateFreq(1, nums[j], freqBits); result = min(result, abs(k - windowOR)); if (windowOR < k) { j++; } else if (windowOR == k) { return 0; } else { while (i < j && windowOR > k) { updateFreq(-1, nums[i], freqBits); i++; windowOR = 0; for (int b = 0; b < 32; b++) { if (freqBits[b] > 0) { windowOR = windowOR | (1
@SaranshKasliwal4 ай бұрын
or use this more cleaner code class Solution { public: void updateFreq(int op,int val,int *freqBits){ int i=0; while(val>0){ if(val & 1){//if the rightmost bit is 1 freqBits[i]+=op; //1 it will increament,-1 in will decrement } val>>=1; i++; } } int minimumDifference(vector& nums, int k) { int n=nums.size(); int freqBits[32]={0}; int i=0,j=0; int OR=0; int res=INT_MAX; while(j
@RamanKumar-gt8nm23 күн бұрын
@codestorywithMik this question statement is chagned to the Or and ihave tried with the reversed logic can you please make a video on it becuase it is unable to submit import java.util.Arrays; class Solution { private void updateFreq(int op, int val, int[] freqBits) { int i = 0; while (val > 0) { if ((val & 1) == 1) { freqBits[i] += op; } val >>= 1; i++; } } public int minimumDifference(int[] nums, int k) { int n = nums.length; if (n == 1) { return Math.abs(nums[0] - k); } int[] freqBits = new int[32]; Arrays.fill(freqBits, 0); int i = 0; int j = 0; int windowOr = 0; int result = Integer.MAX_VALUE; while (j < n) { windowOr |= nums[j]; updateFreq(1, nums[j], freqBits); result = Math.min(result, Math.abs(k - windowOr)); if (windowOr < k) { j++; } else if (windowOr == k) { return 0; } else { while (i k) { updateFreq(-1, nums[i], freqBits); i++; windowOr = 0; for (int b = 0; b < 32; b++) { if (freqBits[b] > 0) { windowOr |= (1
@nish07985 ай бұрын
BRO PLEASE ANSWER THIS QUESTION QUESTION IS IF WE CAN FORM TARGET STRING FROM ARRYA ELEMENTS import java.util.ArrayList; public class Solution { static ArrayList res = new ArrayList(); // Not used in this version public static void main(String[] args) { String[] arr = {"os","mn","pqr","qr"}; String t = "pqros"; //THIS SHOULD RETURN TRUE BCOZ PQR+OS is forming target but it is giivng false should return true technically String sofar = ""; ArrayList l = new ArrayList(); System.out.println(canconst(arr, t, sofar, 0, l)); } public static boolean canconst(String[] arr, String t, String sofar, int idx, ArrayList l) { if(sofar.equals(t)) { return true; } if (idx >= arr.length) { return false; } // Try appending each string from arr to sofar and recursively check if (canconst(arr, t, sofar + arr[idx], idx+1 , l)) { return true; } return canconst(arr, t, sofar, idx + 1, l); } } //THIS SHOULD RETURN TRUE BCOZ PQR+OS is forming target but it is giivng false should return true technically this code is only giivng correct output if the we are checking the idx elements sequence wise why so please answer what changes should i make in my code so that it works galti pakad nai aa rahi please help bhai do ghante ho gaye hit and trial kar raha hu doubt clear kardo aisa kyu horaha hai
@anshtanwar18135 ай бұрын
✌🐱
@yatri63295 ай бұрын
Bro left ya right se remove krna hoga ye depend krega Array sorted hone p ??