Count of Interesting Subarrays | Using Studied Concept | Dry Run | Leetcode 2845 | codestorywithMIK
iPad PDF Link : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad PDF Notes/Leetcode-149-Count Of Interesting Subarrays.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Leetcode - 974 (Subarray Sums Divisible by K) - • Subarray Sums Divisible by K | Brute ...
Hi Everyone, this is the 149th video of our Playlist "Arrays 1D/2D : Popular Interview Problems".
Now we will be solving a good array prefix-sum problem - Count of Interesting Subarrays | Using Studied Concept | Detailed | Dry Run | Leetcode 2845 | codestorywithMIK
We will solve it using the same concept as Leetcode-974. We will do a recap and build intuition and solve it easily.
Problem Name : Count of Interesting Subarrays | Using Studied Concept | Detailed | Dry Run | Leetcode 2845 | codestorywithMIK
Company Tags : will update later
Code Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Arrays/Cumulative_Sum(Prefix Array)/Count of Interesting Subarrays.cpp
Leetcode Link : https://leetcode.com/problems/count-of-interesting-subarrays/description/
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 problem asks us to count subarrays where the number of elements satisfying nums[i] % modulo == k is congruent to k modulo modulo. We keep a running count (sum) of such elements and use the modulo of this sum to track patterns. By using a hash map to store the frequency of each modulo result, we efficiently count the number of valid subarrays ending at each index. The key trick is recognizing that if (sum[i] - sum[j]) % modulo == k, then we can rearrange this to find how many previous prefix sums satisfy that condition.
✨ Timelines✨
00:00 - Introduction
0:35 - Motivation
1:04 - Problem Explanation
5:13 - Thought Process behind counting
17:26 - Recap Leetcode - 974 and Maths Proof
28:28 - Dry Run
34:42 - Coding it up
#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