Given an array of N integers.
We wish to sort these integers but we must remember what their orignal indices were before sorting.
(1) We cannot achieve this with the inbuilt sort function.
(2) 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()).
(3) 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()).
(4) This cannot be achieved without a custom comparator and two arrays.