vector<int> V(n); std::iota(V.begin(),V.end(),0); //Initializing sort( V.begin(),V.end(), [&](int i,int j){return arr[i]<arr[j];} );