WA on submission

I tried understanding the tutorial of stone game from starters 26 held few days back.

Idk why I’m getting a wrong answer when I tried coding the approach myself. Can someone help me debug this code?

My submission: Solution: 58616721 | CodeChef

Thanks in advance :wink: