My code is passing only 2 test cases out of 4

Please let me know what is the problem with my code?
link to code->https://ide.codingblocks.com/s/643425

hi @ikshuldureja130
i have made changes in ur code


it should work fine and pass all test cases… if there is any doubt then do let me know…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.