Solve Subarray Problems Quickly With Sliding Window Technique | FREE DSA Course in JAVA | Lecture 79

Опубликовано: 17 Февраль 2023
на канале: TAP ACADEMY
45,925
1.3k

We have to solve a program known as the maximum sum subarray of size k.

So it means for a given size of subarray k, we have to find the maximum sum of all the subarrays of size k.

For example [2,9,31,-4,21,7] is an array, and k = 3.

Then for k=3 all subarrays are [2,9,31], [9,31,-4], [31,-4,21], [-4,21,7].

Hence the maximum sum is of [31,-4,21] which is 48. So the output will be 48.

Let's see how we can solve this question with a unique technique known as the sliding window technique which can help solve many questions of arrays in an efficient manner.

For more information, fill out this form: https://forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203

Facebook:   / thetapacademy  

Instagram:  / tapacademy_online  

Linkedin:   / 73820805  

Website: https://www.thetapacademy.com​
#java #javaarray #arrayinjava #arrayquestions #coding #dsa #programming #coders #placement