Why aren't the test cases passing

Why aren’t the test cases passing and the answer is coming one more than required pls help debug the code.

@kunal81198
go through this corrected code

Hey can you please tell me what’s wrong in my code