Link to the Problem - CLICK HERE
For Test CASE:
2 6 2 2 5 2 2 2
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.