Bali Pairs Problem link: https://online.codingblocks.com/app/player/61200/content/39623/6269/code-challenge

Here is the code that I tried implementing, some conditions are missing which I am not able to get please help
link:https://ide.codingblocks.com/s/179845

A pure combinatorial approach would be difficult in this question, as a straight formula might be tough to think about. Try to think in terms of what you have now, and what would be added to the answer after you get a pair.
I have added an image to maintain the indentation
and sorry for the late reply. @Codemaniac_Aditya
Keep in mind the parities of odd+odd, odd+even, even+even

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.