Assuming I have two arrays A and B (Both with equal number of elements)
int A[] = {40,50,70};
int B[] = {80,60,45};
I have to rearrange array A in such a way that maximum number of elements in Array A are greater than their respective elements in array B.
In this case, rearranging A as {40,70,50} would yield the required result.
What would be the most optimal way of going this?