Codechef Judge giving wrong answer

I was trying to solve this easy problem: https://www.codechef.com/LTIME56/problems/L56GAME

So i made a solution and submitted it, getting a WA. Tried doing some things differently but still WA.

So i saw one of the solution, but it doing almost exactly what i was doing. So tried again still WA.

So finally out of frustration, i submitted the code that was earlier accepted and that gave WA.

Idk what i am missing, here are the link to both the submissions:
Accepted: https://www.codechef.com/viewsolution/17175600
WA : https://www.codechef.com/viewsolution/25440897

Your solution is wrong.
Try case

1
1
1

It seems the test cases were weak at the time of the contest, but this case was added later at practice section.