Test case 3 showing wrong answer

code:

@myself.yash.srivastav there were few problems in your code. I have edited the code, here is the modified version. Hope this helps.