DSA Learning Series, Distinct Pairs

This question can be solved by finding minimum of first array and maximum of another and printing pairwise.
But why is the converse not true ? Like finding the maximum of first array and minimum of another and then printing pairwise ? Kindly help me out here.

I have edited the question. Sorry for the inconvenience.

https://discuss.codechef.com/t/dpairs-editorial/21631

Look for Setter’s Solution

I have updated the question, thanks for replying though.

look this ->
Best solution

https://discuss.codechef.com/t/best-solution-dpairs-tc-o-n-sc-o-1/62462

1 Like

But why is the converse not true ?

Why do you think that? It is completely true.
https://www.codechef.com/viewsolution/31954531

I got it, I think I messed up while printing them. Thanks. :slight_smile:

i think o(n) is the solution to it not nlog(n)