Code not passing all the test cases

Could you please check why it is not passing all the test cases