Wrong answer

In july lunchtime , question Maximum Candies(CHECHOC), what will be anser for the following test case – 3 1 4 2
I think it will be 3 but i submitted this code - https://www.codechef.com/viewsolution/36028661
and it got submitted !!
Is it due to weak test cases or may be i am wrong??

It should be 4. (2 0 2)

I checked out your code. You did not handle y < x case.
I think the test cases were not strong enough, hence your code passsed.

1 Like

ohh yes , thanks!!