• + 0 comments

    IMO these challanges are getting easier every week. *Pyhon code: *

    def __init__(self):
            self.queue = []
            self.stack = []
    
        def pushCharacter(self, char):
            self.stack.append(char)
        def enqueueCharacter(self, char):
            self.queue.append(char)
        def popCharacter(self):
            return self.stack.pop(-1)
        def dequeueCharacter(self):
            return self.queue.pop(0)