I am deleting the common elements between 2 sorted arrays in both the arrays and returning the arrays with the help of 2 pointers. But I can't figure out the condition in while loop: what should be the condition?
here is my code:
a=[4,8,9,10,12,14,16]
b=[2,8,10,12,13]
i=0
j=0
while():
if (a[i]==b[j]):
a.pop(i)
b.pop(j)
elif(a[i] > b[j]):
j=j+1
else:
i=i+1
print(a)
print(b)