Please give test cases and some reason plsss
1
10 2 10
1 1 1 1 1 1 1 1 1 11
1 Like
Hey,
Thanks for the test case will the answer be 2
we are in the same boat at the moment… CodeChef: Practical coding for everyone
i dont know if there are any other corner cases
Edit there are no corner cases indeed, i had little error in my code above : AC
1 Like
Your code is very correct except a minor mistake…
you are breaking loop if you are at last element of the array. and not actually computing last element of the array.
1 Like