To clear the data of previous steps
arr_s [ : ] = [ ] NEW_LINE for i in range ( 0 , len ( arr ) , 2 ) : NEW_LINE INDENT if i == len ( arr ) - 1 : NEW_LINE INDENT arr_s . append ( arr [ i ] ) NEW_LINE DEDENT else : NEW_LINE INDENT arr_s . append ( mergeTwoArrays ( arr [ i ] , arr [ i + 1 ] ) ) NEW_LINE DEDENT DEDENT arr = arr_s [ : ] NEW_LINE