Stores the array elements with its index
let arrPos = new Array ( n ) ; for ( let i = 0 ; i < n ; i ++ ) arrPos [ i ] = new Array ( 2 ) ; for ( let i = 0 ; i < n ; i ++ ) { arrPos [ i ] [ 0 ] = arr [ i ] ; arrPos [ i ] [ 1 ] = i ; }