Wrong answer for two cases

the code is not running for only two testcases please help.