Help in this question

Getting wrong answer in all test cases
Code Link–https://ide.geeksforgeeks.org/qz2q0NyFAF

hello @Bhawna
please share the problem link as well.

@aman212yadav It is just sample mock not real interview coding round,I have shared screenshots

i checked ur code , it looks correct to me.
can u pls share the problem link , so that i can submit and try

It is one question in set of Amazon Coding Round in Hackerearth .Questions are always shuffled and I cannot send link .

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.