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 ❤❤❤❤
@rugung13817 ай бұрын
please make a videos on this Qn bhaiya🙏 3181. Maximum Total Reward Using Operations II last LC contest ke DP optimisation ke hai
@aws_handles6 ай бұрын
Thanks a lot
@gamersgame43Ай бұрын
only for this video, I learned a new data structure bitmap, and been able to solve the new question which has been changed in leetcode from AND operation to OR operation
@pranavvenkat79717 ай бұрын
Very detailed explanation really enjoyed keep uploading video daily ...your video daily reminder for me to learn DSA daily
@gui-codes7 ай бұрын
please keep posting such long and detailed videos. these are hidden gems. Thanks a lot
@anjanasahay21727 ай бұрын
Please keep on sharing new methods that will help us....with hard problems??? Especially the bitwise manipulation in the preSum types❤❤
@25-cse-csmohitkumarmandal597 ай бұрын
Eagerly waiting for this video ❤ thanks 🙏
@molyoxide83587 ай бұрын
1st comment. Bro pls make a playlist on Bit-Manipulation
@Rajan-xv9cz7 ай бұрын
best explanation really enjoyed♥♥♥
@aws_handles6 ай бұрын
Itna detail paid course me bhi nai milta hoga thanks mik
@22gauravkumar707 ай бұрын
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
@bidishadas8326 ай бұрын
Excellent explanation.
@jailudhani88413 ай бұрын
Is problem statement changed, Previously it was for AND, now I am seeing it is for OR.
@ronniieeestar62747 ай бұрын
Hi @codestorywithMIK leetcode changed this question previously it is AND of subarray now it is OR of subarray
@tanmaykumar40817 ай бұрын
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
@mohd.vaseem74107 ай бұрын
amazing eleplanation
@thefinalfit7 ай бұрын
Thanks a lot for detailing every point
@shashiraj62267 ай бұрын
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.💜
@pokeindia53617 ай бұрын
@shashiraj6226 is it contest q??
@shashiraj62267 ай бұрын
@@pokeindia5361 yes last question of leetcode contest 400
@rev_krakken707 ай бұрын
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?
@jeehub0417 ай бұрын
Superb explaination sir but itna sab contest me figure out karna mushkil hota
@codestorywithMIK7 ай бұрын
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 ❤️
@dayashankarlakhotia49437 ай бұрын
Good explanation 👏 ❤
@gauravbanerjee28987 ай бұрын
Thanks a lot bhaiya ❤❤
@iWontFakeIt7 ай бұрын
maine binary search + prefix sum se solve kiya tha contest k time pe, kyuki wahi mera dimag me chamka tha
@Lakshya-f4l4 ай бұрын
Can you explain the intuition behind your solution?
@FanIQQuiz7 ай бұрын
Netflix ❌ MIK’s Long videos ✅
@English_Vinglish-c9o7 ай бұрын
@codestorywithMIK in brute force shouldnt the loop be from j=i instead of j=0?
@pokeindia53617 ай бұрын
Bhaiya longest valid parantheses q bataiye please..... Ye interview k liye bhi important h..... Please bhaiya
@ramankr00227 ай бұрын
Thank you
@Ronakrewar6 ай бұрын
we can use map approch
@meme-ku1vs7 ай бұрын
thanks
@25-cse-csmohitkumarmandal597 ай бұрын
Mere brute force 806 kuch test case pass kiye the 😅
@pokeindia53617 ай бұрын
Ye contest ka q h kya??
@25-cse-csmohitkumarmandal597 ай бұрын
@@pokeindia5361 yes
@Sumit-wy4zp7 ай бұрын
Yes
@Piyush-yp2po7 ай бұрын
What about nand? (& ~a)?
@HarshPal-i5i7 ай бұрын
hey can you provide your slide also ..... if it is possible
@shivam875S4 ай бұрын
code is giving wrong output plzz check it sir i think leetcode change the testcase
@GR8_Impact7 ай бұрын
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
@SaranshKasliwal6 ай бұрын
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
@aizad786iqbal7 ай бұрын
slack ke messages aa rahe hai :D
@nish07987 ай бұрын
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
@RamanKumar-gt8nm2 ай бұрын
@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
@anshtanwar18137 ай бұрын
✌🐱
@yatri63297 ай бұрын
Bro left ya right se remove krna hoga ye depend krega Array sorted hone p ??