# -*- coding:utf-8 -*-
class Solution:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, node):
# write code here
# stack1存储入栈元素
self.stack1.append(node)
def pop(self):
# return xx
# stack2存储出栈元素,如若stack2不为空,则把stack1中元素倒入stack2
if self.stack2==[]:
while self.stack1:
self.stack2.append(self.stack1.pop())
return self.stack2.pop()



京公网安备 11010502036488号