Video is lengthy ? Use timelines below ❤️ ✨ Timelines✨ 00:00 - Introduction 00:28 - Motivation 02:04 - Problem Explanation 05:29 - Approach-1 Thought Process 16:55 - How to set a bit position ? 18:54 - How to unset a bit position ? 21:52 - How to check if a bit position is set ? 25:13 - Coding Approach-1 in C++ 31:43 - Coding Approach-1 in JAVA 35:51 - Approach-2 Thought Process 45:56 - Coding Approach-2 in C++ 50:10 - Coding Approach-2 in JAVA
I am able to solve today's question by myself. I am realising that slowly I am growing. In this month, I have able to solve most of the POTD's on my own.Few months back, while I was seeing such questions, I had started to watch videos immediately. But now, I first try to solve the question .Then come to watch your video for new approach.Thank you MIK bhaiya❤.
Congrats for 80k 🔥 LEGEND. No wonder you are the most hardworking UA-cam I see. Others posting 10-15 minute videos, and here this Legend posted a postmortem of the approaches. A big thank you from a BEGINNER ❤❤❤
This was definitely easy for someone who has solved questions of bit manipulation. Python implementation of the second approach: class Solution: def minimizeXor(self, num1: int, num2: int) -> int: bitsNum1, bitsNum2 = bin(num1).count("1"), bin(num2).count("1") if bitsNum1 == bitsNum2: return num1 elif bitsNum1 > bitsNum2: num = 0 for i in reversed(range(32)): if bitsNum2 == 0: return num if (num1>>i)&1 == 1: num |= (1i)&1 == 1: num |= (1
other youtubers don't teach everything so that they can then ask us to join their courses. Here MIK posts everything even for a simple problem so that we can understand a problem from every aspect. Hats off to you MIK and congratulations on 80k subs. You will soon reach Millions
I tried out possibilities on paper, and was able to think of approach 2 directly still I came to learn more things. Thanks for all the time you have put in this gem content.
Hii bhaiya mein ne aapka first approach hi socha lekin thoda complicated code likha hai mein ne class Solution { public: int minimizeXor(int num1, int num2) { int ones= 0; int temp= num2; //calculating the number of 1 bits present in num2 while(temp!= 0){ if((temp & 1)== 1) ones++; temp>>= 1; } temp= num1; string n1bits; //Creating a string of num1 while(temp!= 0){ n1bits.push_back((temp&1)+'0'); temp>>= 1; } int n= n1bits.size(); //checking if the ones are equal to number of one present in the n1bits, end to start for(int i= n-1; i>= 0; i--){ if(ones
Thank you so much for the awesome explanation and helpful solution videos! 🙌 I’m pretty new to coding, and even though I understand the logic, but I struggle a lot when it comes to writing or implementing the code. I’ve only learned a few DSA topics so far, so I’m not sure how to handle this. Should I try solving POTD along with learning DSA concepts, or should I focus on covering the DSA topics first? Would really appreciate your advice. Thanks!
Thank you so much for your kind words. I'm glad the videos are helping. Since you're new to coding, I suggest focusing on building a strong foundation in DSA concepts first. Learn one topic at a time and practice a few problems related to it to gain confidence in implementation. Once you're comfortable with the basics, you can start solving POTD (Problem of the Day) as it will help you apply your knowledge and improve problem-solving skills gradually. Remember, consistency is key! Take it step by step, and don't hesitate to revisit concepts if needed. You've got this! 💪
Hello MIK, I purchased your membership and just wanted to know if there are any members-only videos on this channel to which the members will have access. Ya phir sare videos normal subscriber ke liye bhi visible honge. Love your content tho!
Dear Vivek, I want to mention that the membership feature was given by UA-cam after crossing some threshold subscribers count. I usually don’t want any paid service, so the amount for membership should be default value given by UA-cam only. There is no difference in the contents that I provide in membership and non-membership as of now. So if you wish, you can definitely opt-out of the membership . Hope you understand 😇❤️🙏 And thank you for your kind words ❤️
आपका अधिकार ही नहीं कर्म के फल (results) पे, जब अधिकार ही नहीं, तो फल तो आपका है ही नहीं, जिस पे अधिकार है नहीं, वो आपकी हो कैसे सकती? अधिकार केवल कर्म करने का है। तो जिस चीज़ पर अधिकार है, उसे सही से करने का चिंतन कीजिए।
I am able to solve today's question by myself. I am realising that slowly I am growing. In this month, I have able to solve most of the POTD's on my own.Few months back, while I was seeing such questions, I had started to watch videos immediately. But now, I first try to solve the question .Then come to watch your video for new approach.Thank you MIK bhaiya❤.
Video is lengthy ? Use timelines below ❤️
✨ Timelines✨
00:00 - Introduction
00:28 - Motivation
02:04 - Problem Explanation
05:29 - Approach-1 Thought Process
16:55 - How to set a bit position ?
18:54 - How to unset a bit position ?
21:52 - How to check if a bit position is set ?
25:13 - Coding Approach-1 in C++
31:43 - Coding Approach-1 in JAVA
35:51 - Approach-2 Thought Process
45:56 - Coding Approach-2 in C++
50:10 - Coding Approach-2 in JAVA
plaese provides the slide also
aj socha tha k apke video k baad he makarsankranti hogi or finally aa gaya video❤❤
Means a lot ❤
First quote is from Bhagvad Gita, it is the teaching of shree krishna to Arjuna!!!❤
It's BEAUTIFUL ❤
Mik these motivation quotes are lowkey empowering. Helps a lot in keep going. thanks for everything mate.
You are the best.
Means a lot ❤
@@codestorywithMIK Yes MIK. Never stop these motivational quotes at the beginning of your every video...
I am able to solve today's question by myself. I am realising that slowly I am growing. In this month, I have able to solve most of the POTD's on my own.Few months back, while I was seeing such questions, I had started to watch videos immediately. But now, I first try to solve the question .Then come to watch your video for new approach.Thank you MIK bhaiya❤.
So so happy to hear this. Well done.
Want the same bro.
gurrrl what year of collage r u in ?❤
Congrats for 80k 🔥
Means a lot ❤
@@codestorywithMIK soon will be 100k and them 1 M🤗
Congrats for 80k 🔥 LEGEND.
No wonder you are the most hardworking UA-cam I see. Others posting 10-15 minute videos, and here this Legend posted a postmortem of the approaches. A big thank you from a BEGINNER ❤❤❤
Means a lot ❤️
Bit manipulation itne ache se kabhi nhi samjha tha thank you so much 🙏🙏
yes
I have solved this question my own but come here to learn something as you drop 52 min banger and indeed I learnt it.
many many congrats on 80K #mik
Allah apki sare dua kubul kare ❤
quote for tomorrow : To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.🌼
This was definitely easy for someone who has solved questions of bit manipulation.
Python implementation of the second approach:
class Solution:
def minimizeXor(self, num1: int, num2: int) -> int:
bitsNum1, bitsNum2 = bin(num1).count("1"), bin(num2).count("1")
if bitsNum1 == bitsNum2:
return num1
elif bitsNum1 > bitsNum2:
num = 0
for i in reversed(range(32)):
if bitsNum2 == 0:
return num
if (num1>>i)&1 == 1:
num |= (1i)&1 == 1:
num |= (1
other youtubers don't teach everything so that they can then ask us to join their courses.
Here MIK posts everything even for a simple problem so that we can understand a problem from every aspect. Hats off to you MIK and congratulations on 80k subs. You will soon reach Millions
You are a LEGEND.
Congrats on 80K Subs. Soon 100K and then 1M soon
video timeline mai aapka code approach mai "C" like ke aata hai instead of C++
congrats on 80k
InshaAllah 100k will happen soon..
I tried out possibilities on paper, and was able to think of approach 2 directly still I came to learn more things. Thanks for all the time you have put in this gem content.
bro you are best bhagwaan apki aur apke family ki har wish puri kare😇ekdin aapse jarur milunga
Thanks bhai, i watched till 9:35 got some intuition then build my logic to solve the problem .❤❤
first 24:31 is the best for beginners who want to learn bit manipulation
Thank you so much bhaiya. ❤❤ Aj ka question mast tha.
Hello MIK please start solving contest problems
If anyone else feels the same like this 🎉
amazingly explained.
Trust me guys this 52 minutes will be worth it. you will learn lots of thing. So go for it.
Best Quote I've ever heard ❤
Thanks for the solution
Hii bhaiya mein ne aapka first approach hi socha lekin thoda complicated code likha hai mein ne
class Solution {
public:
int minimizeXor(int num1, int num2) {
int ones= 0;
int temp= num2;
//calculating the number of 1 bits present in num2
while(temp!= 0){
if((temp & 1)== 1) ones++;
temp>>= 1;
}
temp= num1;
string n1bits;
//Creating a string of num1
while(temp!= 0){
n1bits.push_back((temp&1)+'0');
temp>>= 1;
}
int n= n1bits.size();
//checking if the ones are equal to number of one present in the n1bits, end to start
for(int i= n-1; i>= 0; i--){
if(ones
congratulations on 80k
Thank you so much for the awesome explanation and helpful solution videos! 🙌
I’m pretty new to coding, and even though I understand the logic, but I struggle a lot when it comes to writing or implementing the code. I’ve only learned a few DSA topics so far, so I’m not sure how to handle this.
Should I try solving POTD along with learning DSA concepts, or should I focus on covering the DSA topics first? Would really appreciate your advice.
Thanks!
Thank you so much for your kind words. I'm glad the videos are helping.
Since you're new to coding, I suggest focusing on building a strong foundation in DSA concepts first. Learn one topic at a time and practice a few problems related to it to gain confidence in implementation.
Once you're comfortable with the basics, you can start solving POTD (Problem of the Day) as it will help you apply your knowledge and improve problem-solving skills gradually.
Remember, consistency is key! Take it step by step, and don't hesitate to revisit concepts if needed. You've got this! 💪
Sir I solved it by myself..no hints..O(n)(actually O(2n)):)
The great geeta motivation.chaptere 2 verse 48
Success is not the result of spontaneous combustion. You must set yourself on fire with purpose, passion, and persistence.
my anxiety📈 with the cooker ki seeti at 14:05
Thank u note for mik❤❤❤
Hello MIK,
I purchased your membership and just wanted to know if there are any members-only videos on this channel to which the members will have access. Ya phir sare videos normal subscriber ke liye bhi visible honge.
Love your content tho!
Dear Vivek,
I want to mention that the membership feature was given by UA-cam after crossing some threshold subscribers count. I usually don’t want any paid service, so the amount for membership should be default value given by UA-cam only.
There is no difference in the contents that I provide in membership and non-membership as of now.
So if you wish, you can definitely opt-out of the membership .
Hope you understand 😇❤️🙏
And thank you for your kind words ❤️
@codestorywithMIK Thank you for being honest.
adding java with c++ is a good move
Waiting for 100k mik😍
because of you I became consistent on leetcode.
thanks a lot mik.
22:19
Here is your trophy for doing post-mortem of sawaals like no one else.
See lil code : 46:00
wow
In the second approach, the new function to check whether bit is unset is redundant. We could just use isSet that we wrote for the first approach.
Tommarow's motivation : Accept what you cant change, change what you cant accept. When you start to see your potential, the grind becomes personal
for only detail explaination i used to prefer your video
Present sir
In case of unset a bit What if we simply xor rather than taking negative and then ANd
I solved it on my own but it took me 40min
Bahiya prefix sum pe playlist bana do😢
i find it difficult to identify edge cases and time complexity. Please any way to improve in this areas.
sir question ke ipads ke solution upload kar digiye
Short Motivation for tomorrow: “A quitter never wins and a winner never quits.”
I fear from Bit Manipulation Q's.
What to do,
I scared when i see bit manipulation questions and unable to solve what to do mikbhai?? ❤❤
dekhunga to aapki video hi dekhunga nhi to q hi ni kru😹😹
(3418. Maximum Amount of Money Robot Can Earn) hey please help me to understand this question`s sol. Please
आपका अधिकार ही नहीं कर्म के फल (results) पे,
जब अधिकार ही नहीं, तो फल तो आपका है ही नहीं,
जिस पे अधिकार है नहीं, वो आपकी हो कैसे सकती?
अधिकार केवल कर्म करने का है।
तो जिस चीज़ पर अधिकार है, उसे सही से करने का चिंतन कीजिए।
I am able to solve today's question by myself. I am realising that slowly I am growing. In this month, I have able to solve most of the POTD's on my own.Few months back, while I was seeing such questions, I had started to watch videos immediately. But now, I first try to solve the question .Then come to watch your video for new approach.Thank you MIK bhaiya❤.