My code is not able to pass all the test cases

This is my code it passes Test case 1 but gives a run time error for Test case 0.
This is my code-