Why test case not passing whats the error

hi @aakshatmalhotra100
refer this https://ide.codingblocks.com/s/643110

i understood your approch but whats the problem in mine

hi @aakshatmalhotra100
just a small mistake in ur code… ur code can print multiple ans… so as soon as a potential ans is found just return from the function as u can see below…
ur code will work fine and pass all test cases…

hope it clears ur doubt…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.