[leetcode-225] Implement Queue using Stacks
ยท
๐Ÿข One step
LeetCode-225 Implement Queue using Stacks : Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack note : last-in-first-out (LIFO) Answer :::python class MyStack: def init(self): self.temp = [] def push(self, x: int) -> None: self.temp.append(x) def pop(self) -> int: return self.temp.pop() def top(self) -> int: r..
๋‹คํ–ˆ๋‹ค
'225' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก