Subarray with least average
Submissions: 5469   Accuracy:


  Difficulty: Easy   Marks: 2

Find the subarray with least average of size K. Given an array arr[] of size n and integer k such that k <= n.

The first line contains an integer 'T' denoting the total number of test cases. In each test cases, the first line contains an integer 'N' and 'K' denoting the size of array. The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of the array.

The first and last index of the subarray. (Index begins from 1).
Note: You may assume that there will only be one unique solution.

1 <= T <= 100
1 <= N <= 1000
1 <= K <= N
1 <= A[i] <= 103

3 1
30 20 10 

3 3

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.