Function to reverse the subarray arr [ 0. . . i ]
void getUpdatedArray ( vector < int > & arr , vector < int > & copy , int i ) { for ( int j = 0 ; j <= ( i / 2 ) ; j ++ ) { copy [ j ] = arr [ i - j ] ; copy [ i - j ] = arr [ j ] ; } return ; }