Output and code is correct.
Why TestCase 1 and 4 are wrong?
Hi @2000bhaveshkumar
Read the question properly. You need the print the pairs in increasing order, i.e. sorted on first element and
print only distinct pairs i.e. avoid repetition.
You must sort the array for this.
Hope this helps
Mark resolved if satisfied 