• + 0 comments
    class Solution:
        def __init__(self):
            self.stack=[]
            self.queue=[]
        def pushCharacter(self,x):
            self.stack.append(x)
        def enqueueCharacter(self,x):
            self.queue.insert(0,x)
        def popCharacter(self):
            return self.stack.pop()
        def dequeueCharacter(self):
            return self.queue.pop()