OPTIMAL GAME STRATEGY-I one testcase failing

pls tell me why one test case is failing ?

Hi!
Please check the comments in the below code


THANKS!