Sliding Window Technique | Google Coding Interview | Maximum Size SubArray Of Size K

preview_player
Показать описание
Sliding Window Technique: In this video, I have explained sliding window technique which is the optimal way to solve maximum size subarray of size K coding interview problem.

There are a lot of coding interview problems which can be solved by using this technique in an optimized way.

✚ Join our community ►

✅ Recommended playlists ►

📖 TOP 10 LEARNING RESOURCES

👋 Let’s Connect ►

#JAVAAID #slidingwindowtechnique #leetcode #javaAidTutorials #programming #dataStructures #algorithms #coding #competitiveprogramming #google #java #codinginterview #problemsolving #kanahaiyaGupta #google #facebook #amazon #oracle #linkedin

DISCLAIMER: These above-mentioned resources have affiliate links, which means if you buy one of the products from my links, I might receive a small commission without having an extra cost to you. This helps support the channel and allows us to continue to add more tutorial. Thank you for your support!
NOTE: All above-shared learning resources are best of my knowledge as I have personally read all except one Introduction to Algorithms.
Рекомендации по теме
Комментарии
Автор

*corrections*
*Initialize the msum to Integer.MIN_VALUE because all the wsum may be negative and in that case the msum will never be updated by the wsum.*

and

in second method, *maxSum = Math.max(maxSum, windowSum);
// added as a part of correction*

public static int A, int k) {
int windowSum = 0, maxSum = Integer.MIN_VALUE;
for (int i = 0; i < k; i++) {
windowSum += A[i];
}
*maxSum = Math.max(maxSum, windowSum);
// added as a part of correction*
for (int windowEndIndex = k; windowEndIndex < A.length; windowEndIndex++) {
windowSum += A[windowEndIndex] - A[windowEndIndex - k];
maxSum = Math.max(maxSum, windowSum);
}
return maxSum;
}

JavaAidTutorials
Автор

Explaining tough problems with a dry explanation is easy and commonplace. Your work is brilliant because it makes tough problems seem easy to solve!

robertsedgewick
Автор

I don't have an interview but was looking for a solution to a sliding window problem for my program, I thank you for your unique style in teaching It's very clear and easy, thank you.

aeon
Автор

I've been Stuck in this particular problem . Have watched many videos. But I can't understand their way of explanation . But you just Nailed it. Keep doing videos in some special questions asked by huge product based companies please.

vigneshhendrix
Автор

I am sure that your subscribers count will grow with exponential complexity.. Keep the great work up😇

aravinddesikamani
Автор

better understanding after watching the video...!! great going man

tentx
Автор

Excellent video and terrific explanation! Best video on this topic on YouTube!

pedestrian
Автор

trust me this the best video u can find in youtube in this topic

saravananj
Автор

Please continue posting of such types of videos it is really very helpful ❤

manshibachhan
Автор

In first for loop you need to write "maxSum =windowSum" because if we are getting the max in our first for loop than we need to return that maxSum;

vaibhavikhachane
Автор

Happily subscribed. Great to see you discussing the patterns. Keep them coming.
One request though, please site some problems that can be solved using the pattern. It will be an exercise to the viewer and will complete the learning cycle

anushree
Автор

I can see your efforts in the present it in a more colorful and meaningful way with a nice presentation and communication. awesome job. I see many youtube, but never see one as you presented it very aesthetically. keep up the good work. your subscribers will increase sooner or later,

sureshgarine
Автор

Thank you for explaining this concept in really nice way.
Awesome 👍👍

guess_ds
Автор

Your explanation on this topic was very clear. Keep it up!

law
Автор

Very nice video sir.Thank you so much..

kanchanjeswani
Автор

Thanks. This is a very common interview question.

mongaslanguagetechnologies
Автор

After 2 weeks at this, I family got it. You are the best. Thank you so much

samrey
Автор

Very cool man, keep up the good work.. thanks for adding the correction.. I know many interviewers today look for these edge cases!

amitaher
Автор

Great explanation..Just continue making such conceptual videos.Its going to help a lot.

subhamjain
Автор

Very easy to understand and nice visual representation of sliding window techniq

vikasmastud