Function to reverse1 the subarray
void reverse1 ( int left , int right , vector < int > & arr ) { while ( left < right ) { int temp = arr [ left ] ; arr [ left ] = arr [ right ] ; arr [ right ] = temp ; ++ left ; -- right ; } }