1371. Find the Longest Substring Containing Vowels in Even Counts | Leetcode POTD Explained

preview_player
Показать описание
🎥 Welcome to Our Coding Channel! 🚀

In this video, we dive deep into an intriguing coding challenge: Find the Longest Substring Containing Vowels in Even Counts ! 🎯

⏱ TIMESTAMPS

🎯 Objective:
In this video, we solve the problem of finding the longest substring where each vowel ('a', 'e', 'i', 'o', 'u') appears an even number of times. We use bit manipulation and hash maps in C++ to solve this efficiently!

💡 Concepts Covered:
- Bitwise operations
- Hash maps in C++
- String manipulation

📈 What You'll Learn:
- How to use a bitmask to track vowels efficiently
- Understanding the use of unordered maps for character manipulation
- Implementing the solution in C++ step by step

🚀 Watch Now and Level Up Your Algorithm Skills!

💻 About Our Channel
Welcome to our channel! Here, We offer solutions to coding problems and teach programming concepts daily, covering everything from data structures and algorithms (DSA) to full-stack development. Dive into our content for in-depth tutorials on frontend and backend development, alongside practical examples and problem-solving techniques. Join us to enhance your coding skills and stay updated on the latest in app development!

Check out our channel here:

🔔 Don’t forget to subscribe!

🎥 Check Out Our Other Videos

🌐 Find Us At

#1371 #potd #leetcodepotd #leetcodesolution #leetcodeblind75 #xor #bitwise
Рекомендации по теме
Комментарии
Автор

Code :-

class Solution {
public:
int s) {
unordered_map<char, int> hash = {
{'a', 1}, {'e', 2}, {'i', 4}, {'o', 8}, {'u', 16}};
vector<int> bitset(32, -1);
int mask = 0, maxLen = 0;
for (int i = 0; i < s.size(); i++) {
mask = mask ^ hash[s[i]];
if (mask != 0 && bitset[mask] == -1) bitset[mask] = i;
maxLen = max(maxLen, i - bitset[mask]);
}
return maxLen;
}
};

codeby_naruto
Автор

You explain nice from others make more video on other important question

yashpant
Автор

Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!

saisampath
Автор

Bhaiya please provide us solution of contest question solution please

ardtierguy
welcome to shbcf.ru