Minimum Size Subarray Sum (LeetCode 209) | Full solution with animations | Variable Sliding Window

preview_player
Показать описание


Chapters:
00:00 - Intro
00:51 - Problem Statement
03:07 - Brute Force Approach
05:05 - Sliding window with 2 pointers
12:18 - Dry-run of Code
16:16 - Final Thoughts

📚 Links to topics I talk about in the video:

📖 Reference Books:

🎥 My Recording Gear:

💻 Get Social 💻

#leetcode #programming #interview
Рекомендации по теме
Комментарии
Автор

thankyou so much sir, wonderful explanation, understood each and every thing perfectly !!

ananyieie
Автор

Got it in one go. Very nice explaination sir ❤

prashantraj
Автор

Sir... please drop a recursion playlist. I find it very confusing. The way you teach is very crisp and clear with all the illustrations.

hajeeramohamad
Автор

I make my self change to understand (solve problem) all video of this channel

Kuldeepa
Автор

why did we add while loop inside instead of if loop ?

Sivashankar_K
Автор

What is the time complexity of this solution ?

nandhakumarkr
Автор

if we are considering continuous sub arrays, then why can't we use prefix sum instead?
this is my code

int minSubArrayLen(int target, vector<int>& nums) {
int sum=0;
for(int i=0;i<nums.size();i++){
if(nums[i]==target)
return 1;
sum+=nums[i];
nums[i]=sum;
}
int count=0;
for(int i=nums.size()-1;i>=0;i--){
if(sum-nums[i]==target){
return count;
}
count++;
}
if(sum==target){
return count;
}
return 0;
}

but giving wrong answer for array [1, 2, 3, 4, 5], whose sum equal 11.

luson_
Автор

From some of past day i found you and really impressed with you, and want to know more about you sir and connect with you in LinkedIn could we??

angelbroker