问题描述
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
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)