Minimum Recolors to Get K Consecutive Black Blocks | 2 Approaches | Leetcode 2379 | codestorywithMIK
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Sliding Window Playlist - • Primality Check | Sieve of Eratosthen...
Hi Everyone, this is the 73rd video of our Playlist "Leetcode Easy : Popular Interview Problems".
Now we will be solving a good practice Sliding Window problem - Minimum Recolors to Get K Consecutive Black Blocks | 2 Detailed Approaches | Leetcode 2379 | codestorywithMIK
We will solve it using 2 Approaches : Brute Force and then Sliding Window using Khandani Template
Problem Name : Minimum Recolors to Get K Consecutive Black Blocks | 2 Detailed Approaches | Leetcode 2379 | codestorywithMIK
Company Tags : will update later
My solutions on Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Sliding Window/Leetcode Easy/Minimum Recolors to Get K Consecutive Black Blocks.cpp
Leetcode Link : https://leetcode.com/problems/minimum-recolors-to-get-k-consecutive-black-blocks
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 :
Approach-1 (Brute Force):
This approach checks every possible contiguous subarray of length k and counts the number of 'W' characters in each. The minimum number of recolors needed is updated as we iterate through all possible subarrays.
Approach-2 (Sliding Window):
Instead of recalculating for every subarray, this approach maintains a sliding window of size k, efficiently updating the count of 'W' as the window moves. This helps in reducing redundant computations and speeds up the process.
✨ Timelines✨
00:00 - Introduction
0:42 - Motivation
1:07 - Problem Explanation
3:19 - Thought Process (Brute Force)
7:30 - Coding Brute Force
9:54 - Brute Force Time & Space Complexity
10:10 - Optimal Approach
11:30 - Dry Run of Optimal Approach
16:54 - Optimal Time & Space Complexity
17:10 - Coding Optimal Approach
#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