We wish to sort these integers but we must remember what their orignal indices were before sorting.
We cannot achieve this with the inbuilt sort function.
We may build a vector> data where data[i].first = AR[i] and data[i].second = i and sort this vector using sort(data.begin(), data.end()).
We may build a vector> data where data[i].first = i and data[i].second = AR[i] and sort this vector using sort(data.begin(), data.end()).
This cannot be achieved without a custom comparator and two arrays.
How can we acheive it