Maximum Sum Subarray With At Least K Elements

1. You are given an array(arr) of integers and a number k.
2. You have to find maximum subarray sum in the given array.
3. The subarray must have at least k elements.
Input Format
A number N
a1
a2.. N integers
A number K
Output Format
A number representing maximum subarray sum with subarray having at least K elements.
Question Video
Constraints
1 <= N <= 10^5
1 <= arr[i] <= 10^5
1 <= K <= N
Sample Input
3
1
2
3
2
Sample Output
6


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name