unable to detect in what condition it will give WA
Your code fails for this test case. Try debugging it and you will get to know the mistake yourself
Your output is a tie but it actually is the win of mongoose . It is because you are eliminating s by first removing the left ones and then the right ones but actually you should check for left of m and if no s is there , instantly check for right .