Hashmap which stores the indexes of the input array
map < int , int > h ; sort ( temp . begin ( ) , temp . end ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) { h [ arr [ i ] ] = i ; } for ( int i = 0 ; i < N ; i ++ ) {