3 test cases are passed, what the problem?

i looks fine but when i submit there are several test cases which are not working with my solution.
can you modify my code and tell me where i am going wrong with which specific test cases.

https://www.codepile.net/pile/K8E4YJx5

here’s the updated one