You are viewing a single comment's thread. Return to all comments →
Python 3
class Solution: def __init__(self): self.stack, self.queue = [], [] def pushCharacter(self,a): self.stack.append(a) def popCharacter(self): return self.stack.pop() def enqueueCharacter(self,a): self.queue.append(a) def dequeueCharacter(self): return self.queue.pop(0)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 18: Queues and Stacks
You are viewing a single comment's thread. Return to all comments →
Python 3