Create a copy of arrp [ ] in temp and sort the temp array in increasing order
let temp = new Array ( n ) ; for ( let i = 0 ; i < n ; i ++ ) temp [ i ] = arr [ i ] ; temp . sort ( function ( a , b ) { return a - b ; } ) ;