Code is running output for sample test case is also correct.. still two test cases are wrong .. please help

code --> https://ide.codingblocks.com/s/224931

Hello @anmol1911,

There is a mistake in your code.
I have corrected it:


Refer to comments if you are satisfied.

Hope, this would help.
Give a like if you are satisfied.

1 Like

Thanks,for the quick reply … It was a silly mistake … yet I couldn’t find it …:sweat_smile:

Hey @anmol1911,

It happens.
This is because for you the logic was correct. Moreover, the output for the sample input was coming out true.
So, you should always try to think of different types of test cases and then execute it for your code to find the errors.

Please, mark it as resolved if you don’t have any more issues regarding this doubt.

1 Like