loop to merge l and r using two pointer
while ( l_in + r_in < l . size ( ) + r . size ( ) ) { if ( l_in != l . size ( ) && ( r_in == r . size ( ) l [ l_in ] < r [ r_in ] ) ) { ret . push_back ( l [ l_in ] ) ; l_in ++ ; } else { ret . push_back ( r [ r_in ] ) ; r_in ++ ; } } return ret ; }