Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.hackerrank.com/challenges/30-queues-stacks/problem
- class Solution {
- //Write your code here
- Stack<char> stack = new Stack<char>();
- Queue<char> queue = new Queue<char>();
- public void pushCharacter(char ch)
- {
- stack.Push(ch);
- }
- public void enqueueCharacter(char ch)
- {
- queue.Enqueue(ch);
- }
- public char popCharacter()
- {
- return stack.Pop();
- }
- public char dequeueCharacter()
- {
- return queue.Dequeue();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement