Test cases not solved

Thank you for pointing out the mistakes and I have made the changes as you suggested, but the issue still persists, test cases 0 and 1 are not solved.

Code Link: https://ide.codingblocks.com/s/576892

Hi. first of all no need to use the 2 loops.U can do it one loop also. Also In your code u have used comparator function but u have not sorted ur array anywhere.

U can refer this one. If u still have any doubts u can msg back here.

Hi, if your doubt was resolved , please mark it resolved
else if u still have any doubt regarding this question, u can post it here : )

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.