K-sizes subarray sum

https://hack.codingblocks.com/app/dcb/1382
(in this question i am unable to understand the output as according to given test case output i think should be 0)

@Rishabhsharm its 1 based indexing
i hope it is cleared now if yes dont forget to mark the doubt as resolved

then whats wrong in my code

5 2
2 3 1 1 9
ans = 4 , your o/p = 3
@Rishabhsharm

5 2 2 3 1 1 9 ans = 4 , your o/p = 3why the answer is 4, as minimum sum subarray of size 2 is [1.1] and its starting index is 3 (as it is 1 based indexing)

ohh sorry i thought we have to find max . wait some time i will see

ok i m waiting for your answer sir

there is some error in test case i think someone is looking into it . will tell you when it gets corrected

ok sir , but please let me know when it gets corrected

yeah okay will tell you. my code was also not passing i checked the output file and it contain a long string and in next line lot of numbers :sweat_smile:

@Rishabhsharm its corrected now and i have also corrected your code

it passes all the test case,but still not got ,it should return index,but for given sample test case, it gives 3 as output?

although the answer should be 1 for given test case

@Rishabhsharm its giving 1

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.