Leetcode 232. 用栈实现队列 Implement Queue using Stacks - Python 用双栈实现队列
classMyQueue:def__init__(self):self.stack_in=[]self.stack_out=[]defpush(self,x:int)->None:self.stack_in.append(x)defpop(self)->int:ifself.empty():returnNoneelifself.stack_out:returnself.stack_out.pop(