Count of Substrings Containing Every Vowel and K Consonants II | Leetcode 3306 | codestorywithMIK
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Sliding Window Playlist - • Sliding Window : Popular Interview Pr...
Hi Everyone, this is the 35th video of our Playlist "Sliding Window : Popular Interview Problems".
Now we will be solving a very good Sliding Window problem - Count of Substrings Containing Every Vowel and K Consonants II | Super Detailed | Dry Run | Leetcode 3306 | codestorywithMIK
We will understand from Brute Force why it is a Sliding Window Problem and then we will use the same Khandani Template of Sliding Window.
We will do a deep dive and complete dry run of a big example to make things easy.
Problem Name : Count of Substrings Containing Every Vowel and K Consonants II | Super Detailed | Dry Run | Leetcode 3306 | codestorywithMIK
Company Tags : will update later
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Sliding Window/Count of Substrings Containing Every Vowel and K Consonants II.cpp
Leetcode Link : https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-ii
My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | ...
My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will...
My Segment Tree Concepts Playlist : • Segment Tree | Introduction | Basics ...
My Recursion Concepts Playlist : • Introduction | Recursion Concepts And...
Trie Playlist - • Word Search II (Google, Amazon, Meta,...
Difference Array Technique: Concepts & Qns : • Introduction | What | How | Differenc...
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel : / @codestorywithmik
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
Video Summary :
The approach uses a sliding window to maintain a valid substring where exactly k consonants are present. A hash map tracks vowel counts to ensure all five vowels exist in the window. By precomputing the next consonant index, the algorithm efficiently counts valid substrings by extending the right boundary while adjusting the left. This ensures an optimized search for substrings meeting the given conditions.
✨ Timelines✨
00:00 - Introduction
0:18 - Motivation
1:07 - Problem Explanation
2:34 - Brute Force
3:36 - Why Sliding Window
4:57 - Khandani Template + Complete Dry Run
9:17 - Most important Part
36:04 - How to fill nextConsonantIdx array
42:26 - Coding it up
49:30 - Time & Space Complexity
#MIK #mik #Mik
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik