loop to merge l and r using two pointer
while l_in + r_in < len ( l ) + len ( r ) : NEW_LINE INDENT if ( l_in != len ( l ) and ( r_in == len ( r ) or l [ l_in ] < r [ r_in ] ) ) : NEW_LINE INDENT ret . append ( l [ l_in ] ) NEW_LINE l_in += 1 NEW_LINE DEDENT else : NEW_LINE INDENT ret . append ( r [ r_in ] ) NEW_LINE r_in += 1 NEW_LINE DEDENT DEDENT return ret NEW_LINE