The Lead Game: WA

I tried many test cases and they all work but am getting WA after submitting.

My code is as follows here : https://ideone.com/YLiVkX