Implement a first-in-first-out (FIFO) queue using only two stacks.
public class MyQueue {
private Stack<int> input = new();
private Stack<int> output = new();
public void Push(int x) {
// TODO: implement your solution here
}
public int Pop() {
// TODO: implement your solution here
return 0;
}
public int Peek() {
// TODO: implement your solution here
return 0;
}
public bool Empty() {
// TODO: implement your solution here
return false;
}
}MyQueue q = new MyQueue(); q.Push(1); q.Push(2); q.Peek(); // 1 q.Pop(); // 1 q.Empty(); // falsenull