Professional Documents
Culture Documents
New Text Document
New Text Document
if ind < n:
for i in range(ind,n):
subsets(arr+[nums[i]],nums,n,i+1)
print(arr)
t=int(input())
l=[0]*11
n=len(l)
top1=-1
top2= n
for i in range(t):
s=input().split()
if s[0]=="push1":
x=int(s[-1])
if top1 < top2-1:
top1+=1
l[top1]=x
else:
print("Full hi")
elif s[0]=="push2":
x=int(s[-1])
if top1 < top2-1:
top2-=1
l[top2]=x
else:
print("full hello")
elif s[0]=="pop1":
if top1>=0:
print(l[top1])
top1-=1
else:
print("Empty hi")
elif s[0]=="pop2":
if top2<n:
print([top2])
top2+=1
else:
print("empty hello")
print(l)
def subsets(nums):
res = []
backtrack(res, [], nums, 0)
return res