No test case is being passed

I have checked and re-checked my code thoroughly, gone through similar doubts, yet none of the 4 test cases are getting passed, even though the sample test case gives the correct output. Please help.

hello @Aryaman01
pls save ur code at cb ide and share its link with me

Hi here it is

check now->

oh wow thanks! i didnt realise sorting would affect the answer.

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.