i want to known the time complexity of this code python3 code :
def twoStacks(maxSum, a, b):
# Write your code here
sum_all=0
times=-1
while sum_all<maxSum:
if a[0]<b[0] and len(a)>0 and len(b)>0 or len(a)>0 and len(b)==0:
poped_a=a.pop(0)
sum_all=sum_all+poped_a
times=times+1
elif a[0]>b[0] and len(a)>0 and len(b)>0 or len(b)>0 and len(a)==0:
poped_b=b.pop(0)
sum_all=sum_all+poped_b
times=times+1
return times