C# solutions (one-stack, two-stack, List)
Two-stack solution\n\npublic class MinStack {\n\n    private Stack<int> stack1;\n    private Stack<int> stack2;\n    \n    /** initialize your data structure he
**Two-stack solution**\n```\npublic class MinStack {\n\n    private Stack<int> stack1;\n    private Stack<int> stack2;\n    \n    /** initialize your data structure here. */\n    public MinStack() {\n        stack1 = new Stack<int>();\n        stack2 = new Stack<int>();\n    }\n    \n    public void Push(int x) {\n        if(stack1.Count == 0)\n        {         \n            stack1.Push(x);\n            stack2.Push(x);\n        }\n        else\n        {\n            stack1.Push(x);\n            int currMin = stack2.Peek();\n            stack2.Push(Math.Min(x, currMin));\n        }\n    }\n    \n    public void Pop() {\n        stack1.Pop();\n        stack2.Pop();\n    }\n    \n    public int Top() {\n        return stack1.Peek();\n    }\n    \n    public int GetMin() {\n        return stack2.Peek();    \n    }\n}\n```\n\n**One-stack solution**\n```\npublic class MinStack {\n\n    private Stack<(int,int)> stack;\n   \n    /** initialize your data structure here. */\n    public MinStack() {\n        stack = new Stack<(int, int)>();\n    }\n    \n    public void Push(int x) {\n        if(stack.Count == 0)\n            stack.Push((x, x));\n        else\n            stack.Push((x, Math.Min(x, stack.Peek().Item2)));\n    }\n    \n    public void Pop() {\n        stack.Pop();\n    }\n    \n    public int Top() {\n        return stack.Peek().Item1;\n    }\n    \n    public int GetMin() {\n        return stack.Peek().Item2;\n    }\n}\n```\n\n**List solution**\n```\npublic class MinStack {\n\n    private List<int> list;\n   \n    /** initialize your data structure here. */\n    public MinStack() {\n        list = new List<int>();\n    }\n    \n    public void Push(int x) {\n        list.Add(x);\n    }\n    \n    public void Pop() {\n        list.RemoveAt(list.Count - 1);\n    }\n    \n    public int Top() {\n        return list[list.Count - 1];\n    }\n    \n    public int GetMin() {\n        return list.Min();\n    }\n}\n```
[]