2 Accepted Solution giving 2 different outputs - SLAEL , ENCO2018

Link to the Problem - CLICK HERE

For Test CASE:

1

8 4

2 6 2 2 5 2 2 2

The Correct OUTPUT is 6 but the AC solution this gives OUTPUT 4 where as some other AC solutions gives OUTPUT 6 like this.

First i have written this which gives 6 OUTPUT but this got WA.

Then after observing AC solution I have edited my code to this which gives OUTPUT 4 and this got AC. How can we trust these questions. This question have ruined my competition and many other competitor.

You got the answer wrong. Someone else got lucky and their wrong answer didn’t make the same mistake as yours did - but they were still wrong.

The people who should be complaining are those who actually got the answer right, since their reward for accuracy was diluted by people who got lucky with wrong answers.