solved It in 2 minutes . Just imagine if we have a string and we have to check palindrome so the number of odd frequency of a character should be 0 or 1 ... Thank you Bhaiyaa for your amazing Teaching skills . You are Gem.
I have been doing daily problem from last 10 days and today before seeing your explanation i solved the problem in same way, and went through ur full video, Thankyou bhaiya your consistency making me to work daily❤ You are big motivation.
I can see the hard work you put in your videos, you explain multiple examples and the stress you put in the video so that even beginners can understand is commendable. I salute you for your dedication. You don't care about views, you care about the quality. This makes you different from other youtubers. I bet no one would have made a detailed video on this problem like you did. Seemed like a complete interview
mai odd frequency waale me stuck hogaya tha yaar. Almost solve hogaya tha. but then solve karliya after hint from here. How many Qns you guys practice in a week or day ?
bro you are RONALDO OF explaining stuff with simple way. Please never stop this :) Thanks for doing this nd soo you will be getting silver play button can u please do face revel :) in 2025 ??
Simple Solution (Pin) approach- step 1 : Calculate the frequency of characters in String. step 2 : count odd characters step 3 : if odd characters are greater than k --> return false else return true; class Solution { public: bool canConstruct(string s, int k) {
if(s.size() < k) return false; unordered_map m; for(char &ch:s)m[ch]++; int odd = 0;
I observed various permutations and combinations of strings and k values, and observed after 1-2 hours that if if number of odd freq characters > k, then k palindromes can't be made
Hi Mazhar, I recently stumbled upon a video taking about Agentic AI and how it is gonna replace the future engineers, after watching the video I had few questions in my mind like as a fresher or beginner to coding is it worth learning dsa? or how can I be relevant to the IT industry .please address these kinda topics as well on your Instagram reels.
Very good point. Let me elaborate to help you with this. DSA is the Foundation: As a fresher or beginner, learning Data Structures and Algorithms (DSA) is crucial. Most top companies like Meta, Google, Microsoft, and Amazon heavily emphasize DSA during the initial rounds of their hiring process. It helps you build problem-solving skills and logical thinking, which are the cornerstones of programming. Expand Beyond DSA: While DSA is essential, you should also focus on System Design and Object-Oriented Programming (OOPs) as you grow. These skills are critical for solving real-world problems and working on scalable projects. Learn Practical Skills: To stay relevant in the IT industry, it’s important to learn frameworks and tools that are widely used in development. For example: Spring Boot for backend development. React.js or Angular for frontend development. Databases (SQL and NoSQL) to manage and query data. Version Control (like Git) for collaborative coding. Embrace New Trends: AI and other emerging technologies are reshaping the industry. Instead of fearing them, use them to your advantage. For instance: Learn how to integrate AI tools into your projects. Use AI to automate repetitive tasks and enhance your productivity. Explore fields like Machine Learning, Data Science, or DevOps if they interest you. AI Can’t Replace Everything: AI might automate some repetitive tasks, but it can’t replace critical thinking, creativity, and problem-solving-skills that you’ll develop by learning DSA and working on real-world projects. In short, start with DSA to crack interviews and build a strong foundation. Then, gradually learn frameworks, tools, and trends like AI to grow your career. I’ll definitely create a reel on this topic soon to help others like you. Thanks for the suggestion! 🙌
**Approach-2: Using Bit Manipulation instead of frequency map** Code: class Solution { public: bool canConstruct(string& s, int k) { if(s.length() < k) return false; if(s.length() == k) return true; int n = s.length(); // first 26 bits of freq variable is used to store frequencies int freq = 0; for(char& ch: s) { int pos = ch - 'a'; // use xor to toggle bits, odd frequencies are always set to 1 and even to 0 freq = (1 i) & 1) oddCnt++; } return oddCnt
par bhaiya question kuch alag sa tha mujhe toh thodi der lagi samaj ne me i was consfused like : agar "annabelle" each char. can make palindrome and it's => 9 and it is not true, also we can make = "anna" , "elble" or "anbna" , "elle" then leetcode can can be true as well cause we can make some palindrome from it too but then i realised that we have to take every element while making palindrome and here it is code: class Solution { public: bool canConstruct(string s, int k) { int n = s.size(); if(n < k) return false; if(n == k) return true;
vector freq(26); int oddNum = 0; for(auto &ch : s) freq[ch - 'a']++; for(int i=0; i
i solved this question by myself just in 5 minutes without watching ,thanks bhaiya class Solution { public: bool canConstruct(string s, int k) { if(s.size()
Hi Mazhar, thanks for the video ❤ I wanted to know your opinion about this video ua-cam.com/users/shortssMVWajWI4_Y How to be relevant in IT field like when I see this kinda video I feel like is it even worth learning all these dsa concept as a college student as in upcoming few years there will be no job. Please address this and it would be very helpful if you post tech trend and how to be relevant in industry kinda videos on your Instagram handle. Or reels like these which kinda scares freshers.
DSA is the Foundation: As a fresher or beginner, learning Data Structures and Algorithms (DSA) is crucial. Most top companies like Meta, Google, Microsoft, and Amazon heavily emphasize DSA during the initial rounds of their hiring process. It helps you build problem-solving skills and logical thinking, which are the cornerstones of programming. Expand Beyond DSA: While DSA is essential, you should also focus on System Design and Object-Oriented Programming (OOPs) as you grow. These skills are critical for solving real-world problems and working on scalable projects. Learn Practical Skills: To stay relevant in the IT industry, it’s important to learn frameworks and tools that are widely used in development. For example: Spring Boot for backend development. React.js or Angular for frontend development. Databases (SQL and NoSQL) to manage and query data. Version Control (like Git) for collaborative coding. Embrace New Trends: AI and other emerging technologies are reshaping the industry. Instead of fearing them, use them to your advantage. For instance: Learn how to integrate AI tools into your projects. Use AI to automate repetitive tasks and enhance your productivity. Explore fields like Machine Learning, Data Science, or DevOps if they interest you. AI Can’t Replace Everything: AI might automate some repetitive tasks, but it can’t replace critical thinking, creativity, and problem-solving-skills that you’ll develop by learning DSA and working on real-world projects. In short, start with DSA to crack interviews and build a strong foundation. Then, gradually learn frameworks, tools, and trends like AI to grow your career. I’ll definitely create a reel on this topic soon to help others like you. Thanks for the suggestion! 🙌
SOOO much effort MIK Sir.Thankyouu for teaching soo well ,could not help soo commenting
solved It in 2 minutes . Just imagine if we have a string and we have to check palindrome so the number of odd frequency of a character should be 0 or 1 ... Thank you Bhaiyaa for your amazing Teaching skills . You are Gem.
I have been doing daily problem from last 10 days and today before seeing your explanation i solved the problem in same way, and went through ur full video, Thankyou bhaiya your consistency making me to work daily❤ You are big motivation.
I am glad my videos motivate you to work daily. Keep it up! 💪💪🔥🔥❤️❤️
I can see the hard work you put in your videos, you explain multiple examples and the stress you put in the video so that even beginners can understand is commendable. I salute you for your dedication.
You don't care about views, you care about the quality. This makes you different from other youtubers. I bet no one would have made a detailed video on this problem like you did. Seemed like a complete interview
so true :)
true
i solved it by my own after 1.5 hr time , i surprised see i used same method (count odd frequencies)
same here bro
mai odd frequency waale me stuck hogaya tha yaar. Almost solve hogaya tha. but then solve karliya after hint from here.
How many Qns you guys practice in a week or day ?
well explained brother
Hi thanks brother for such efforts...i am new to dsa and you are helping me a lot
thanks for these hindi videos
I’m glad my videos are helping you. Keep it up! ❤️🙏
Bhaiyaaa lots of love and appreciation for your hard work ❤❤❤
bro you are RONALDO OF explaining stuff with simple way. Please never stop this :) Thanks for doing this nd soo you will be getting silver play button can u please do face revel :) in 2025 ??
Now that i see the video , the logic was simple. But couldn't think of the approach on my own . Thanks.
Growth is a steady rise, unseen but unstoppable
Motivation++;
Java ki hattrick yay🎉❤
gajab, kamal, majedar💥💥💥
I was very close to solving this completely. Just paused your video in the mid and got it. Hats off to your detailed points in the explanation. ❤
thanks for java code
Superb explanation ❤❤
mast explanation. done easily. examples helped a lot
Goated channel
awesome explaination !!!
Thank you! ❤️😇🙏
Simple Solution (Pin)
approach-
step 1 : Calculate the frequency of characters in String.
step 2 : count odd characters
step 3 : if odd characters are greater than k --> return false
else return true;
class Solution {
public:
bool canConstruct(string s, int k) {
if(s.size() < k) return false;
unordered_map m;
for(char &ch:s)m[ch]++;
int odd = 0;
for(auto &ele : m){
if(ele.second % 2 == 0)even++;
else odd++;
}
if(odd
Well done ❤️
I pray you reach Million soon MIK
the code logic is easy but i couldnt approach the question ;)
Please start a playlist for Competative Programming
I observed various permutations and combinations of strings and k values, and observed after 1-2 hours that if if number of odd freq characters > k, then k palindromes can't be made
ऐसी की तैसी 😂
bhaiya ye strings ke questions nahi hore kuch playlist wagera btaiye jahase chalu kr sake
Hi Mik , Thanks for the great explanation , but how do we solve this with brute force ?
Hi Mazhar, I recently stumbled upon a video taking about Agentic AI and how it is gonna replace the future engineers, after watching the video I had few questions in my mind like as a fresher or beginner to coding is it worth learning dsa? or how can I be relevant to the IT industry .please address these kinda topics as well on your Instagram reels.
Very good point. Let me elaborate to help you with this.
DSA is the Foundation:
As a fresher or beginner, learning Data Structures and Algorithms (DSA) is crucial. Most top companies like Meta, Google, Microsoft, and Amazon heavily emphasize DSA during the initial rounds of their hiring process. It helps you build problem-solving skills and logical thinking, which are the cornerstones of programming.
Expand Beyond DSA:
While DSA is essential, you should also focus on System Design and Object-Oriented Programming (OOPs) as you grow. These skills are critical for solving real-world problems and working on scalable projects.
Learn Practical Skills:
To stay relevant in the IT industry, it’s important to learn frameworks and tools that are widely used in development. For example:
Spring Boot for backend development.
React.js or Angular for frontend development.
Databases (SQL and NoSQL) to manage and query data.
Version Control (like Git) for collaborative coding.
Embrace New Trends:
AI and other emerging technologies are reshaping the industry. Instead of fearing them, use them to your advantage. For instance:
Learn how to integrate AI tools into your projects.
Use AI to automate repetitive tasks and enhance your productivity.
Explore fields like Machine Learning, Data Science, or DevOps if they interest you.
AI Can’t Replace Everything:
AI might automate some repetitive tasks, but it can’t replace critical thinking, creativity, and problem-solving-skills that you’ll develop by learning DSA and working on real-world projects.
In short, start with DSA to crack interviews and build a strong foundation. Then, gradually learn frameworks, tools, and trends like AI to grow your career. I’ll definitely create a reel on this topic soon to help others like you. Thanks for the suggestion! 🙌
bhaiya pata nhi kaise but 2 examples ka dry run kiya tha aur answer chamak gaya , same method , ab khud pr doubt ho raha h ki kaise kr liya🤣🤣
🤣🤣🤣
**Approach-2: Using Bit Manipulation instead of frequency map**
Code:
class Solution {
public:
bool canConstruct(string& s, int k) {
if(s.length() < k) return false;
if(s.length() == k) return true;
int n = s.length();
// first 26 bits of freq variable is used to store frequencies
int freq = 0;
for(char& ch: s) {
int pos = ch - 'a';
// use xor to toggle bits, odd frequencies are always set to 1 and even to 0
freq = (1 i) & 1) oddCnt++;
}
return oddCnt
how did you come up with that. like I kinda suck at bit manipulation can you give me some suggestions or recommendations...
Bhaiya i have got the intution of counting the characters and store it into hashmap but i was not able to to get the intution of s.length
Bhai please continue dp concepts!!!
Yes coming soon ❤️
bhaiya can you all tell that how your logic building was improve how to improve it
Please make a video on morris traversal and flattening binary tree into linked list i can't understand from any videos available on youtube bhaiya
If possible please upload the video within upcoming week please bhaiya
Morris Traversal - ua-cam.com/video/Wq3ibaP4dJY/v-deo.htmlsi=Tz-3rVL9K_aGv_CA
😇❤️🙏
Flattening Qn - ua-cam.com/video/NzXtnzQTouk/v-deo.htmlsi=BkguYRGK8O3vIumU
❤️😇🙏
Awesome bhaiya you are great i was unable to find these video for that i am sorry 😂 you makes every concept very easy to implement thanks alot bhaiya❤
par bhaiya question kuch alag sa tha
mujhe toh thodi der lagi samaj ne me
i was consfused like :
agar "annabelle" each char. can make palindrome and it's => 9
and it is not true, also we can make = "anna" , "elble" or "anbna" , "elle"
then leetcode can can be true as well cause we can make some palindrome from it too
but then i realised that we have to take every element while making palindrome
and here it is
code:
class Solution {
public:
bool canConstruct(string s, int k) {
int n = s.size();
if(n < k) return false;
if(n == k) return true;
vector freq(26);
int oddNum = 0;
for(auto &ch : s) freq[ch - 'a']++;
for(int i=0; i
Aisi ki taisi 😂😂
i solved this question by myself just in 5 minutes without watching ,thanks bhaiya
class Solution {
public:
bool canConstruct(string s, int k) {
if(s.size()
bro why so many add
sry for saying this but investing 40 min in a 20 min ques is needed? i thougth bhaiya aaj kuch naya padaege
why stop sharing ipad notes with videos
Hi Mazhar, thanks for the video ❤
I wanted to know your opinion about this video ua-cam.com/users/shortssMVWajWI4_Y
How to be relevant in IT field like when I see this kinda video I feel like is it even worth learning all these dsa concept as a college student as in upcoming few years there will be no job.
Please address this and it would be very helpful if you post tech trend and how to be relevant in industry kinda videos on your Instagram handle.
Or reels like these which kinda scares freshers.
DSA is the Foundation:
As a fresher or beginner, learning Data Structures and Algorithms (DSA) is crucial. Most top companies like Meta, Google, Microsoft, and Amazon heavily emphasize DSA during the initial rounds of their hiring process. It helps you build problem-solving skills and logical thinking, which are the cornerstones of programming.
Expand Beyond DSA:
While DSA is essential, you should also focus on System Design and Object-Oriented Programming (OOPs) as you grow. These skills are critical for solving real-world problems and working on scalable projects.
Learn Practical Skills:
To stay relevant in the IT industry, it’s important to learn frameworks and tools that are widely used in development. For example:
Spring Boot for backend development.
React.js or Angular for frontend development.
Databases (SQL and NoSQL) to manage and query data.
Version Control (like Git) for collaborative coding.
Embrace New Trends:
AI and other emerging technologies are reshaping the industry. Instead of fearing them, use them to your advantage. For instance:
Learn how to integrate AI tools into your projects.
Use AI to automate repetitive tasks and enhance your productivity.
Explore fields like Machine Learning, Data Science, or DevOps if they interest you.
AI Can’t Replace Everything:
AI might automate some repetitive tasks, but it can’t replace critical thinking, creativity, and problem-solving-skills that you’ll develop by learning DSA and working on real-world projects.
In short, start with DSA to crack interviews and build a strong foundation. Then, gradually learn frameworks, tools, and trends like AI to grow your career. I’ll definitely create a reel on this topic soon to help others like you. Thanks for the suggestion! 🙌