Last active
April 29, 2017 16:21
-
-
Save niquepa/59c905a366c439560e5f69ce193660ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution | |
# Write your code here | |
def initialize | |
@stack = Array.new | |
@queue = Array.new | |
end | |
def pushCharacter(c) | |
@stack.push(c) | |
end | |
def enqueueCharacter(c) | |
@queue.unshift(c) | |
end | |
def popCharacter | |
@stack.pop | |
end | |
def dequeueCharacter | |
@queue.pop | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment