8-Line Single Stack Time O(1) for all 4 operations
public class MinStack {\n        private readonly Stack<long> stack = new Stack<long>();\n        private long min = 0l;\n        public void Push(int x){\n    
    public class MinStack {\n        private readonly Stack<long> stack = new Stack<long>();\n        private long min = 0l;\n        public void Push(int x){\n            stack.Push((long)x - (min = stack.Count == 0 ? (long)x : min));\n            if ((long)x < min) min = (long)x;\n        }\n        public void Pop(){\n            if(stack.Peek() < 0) min -= stack.Peek();\n            stack.Pop();\n        }\n        public int Top(){\n            return stack.Peek() < 0 ? (int)min : (int)(min + stack.Peek());\n        }\n        public int GetMin(){\n            return (int)min;\n        }\n    }
[]