merge of 2 inverted list
def Merge(p1, p2):
answer = []
i = j = 0
while i < len(L1) or j < len(L2):
if p1[i] == p2[j]:
answer.append(p1[i])
i += 1
j += 1
elif p1[i] > p2[j]:
answer.append(p2[j])
j += 1
else:
answer.append(p1[i])
i += 1
return answer
Merge([13, 57, 61, 114, 987, 1000], [5, 23, 57, 63, 114, 257, 1000])
[5, 13, 23, 57, 61, 63, 114, 257, 987, 1000]