Function to merge the subarrays arr [ l . . m ] and arr [ m + 1 , . . r ] based on indices [ ]
function merge ( indices , a , l , mid , r ) { let temp_ind = [ ] ; let j = mid + 1 ; let i = 0 , temp_l = l , k ; while ( l <= mid && j <= r ) {