You are viewing a single comment's thread. Return to all comments →
pretty simple in python3:
class Solution: def __init__(self): self.mystack = list() self.myqueue = list() return(None) def pushCharacter(self, char): self.mystack.append(char) def popCharacter(self): return(self.mystack.pop(-1)) def enqueueCharacter(self, char): self.myqueue.append(char) def dequeueCharacter(self): return(self.myqueue.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 →
pretty simple in python3: