LeetCode 232 Implement Queue using Stacks
class Queue { stack<int> input, output; public: void push(int x) { input.push(x); } void pop(void) { peek(); output.pop(); } int peek(void) { if (output.empty()) while (input.size()) output.push(input.top()), input.pop(); return output.top(); } bool empty(void) { return input.empty() && output.empty(); } };