Very simple golang solution | O(1) time
Approach\n Describe your approach to solving the problem. \nWe maintain a main stack and another stack called min. Whenever we push inside the main stack, we al
# Approach\n<!-- Describe your approach to solving the problem. -->\nWe maintain a main stack and another stack called min. Whenever we push inside the main stack, we also push the minimum of the topmost value of min stack and new value to the top most of min stack.  \nWhenever we pop the main stack, we will also pop out the min stack. This is because if at any point the lowest value is popped out of the main stack, then it no longer remains the minimum value of the main stack. For this reason we have the min stack, which represents the minimum value at any point in the main stack.\nFor getting the min at any point, we return the value of the top pointer of the min stack \n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n# Code\n```\ntype MinStack struct {\n\tstack []int\n\tmin   []int\n\ttop   int\n}\n\nfunc Constructor() MinStack {\n\treturn MinStack{[]int{}, []int{}, -1}\n}\n\nfunc (this *MinStack) Push(val int) {\n\tif this.top == -1 {\n\t\tthis.min = append(this.min, val)\n\t} else {\n\t\tthis.min = append(this.min, min(val, (this.min)[this.top]))\n\t}\n\tthis.stack = append(this.stack, val)\n\tthis.top++\n}\n\nfunc (this *MinStack) Pop() {\n\tthis.stack = this.stack[:this.top]\n\tthis.min = this.min[:this.top]\n\tthis.top--\n\treturn\n}\n\nfunc (this *MinStack) Top() int {\n\treturn (this.stack)[this.top]\n}\n\nfunc (this *MinStack) GetMin() int {\n\treturn (this.min)[this.top]\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n/**\n * Your MinStack object will be instantiated and called as such:\n * obj := Constructor();\n * obj.Push(val);\n * obj.Pop();\n * param_3 := obj.Top();\n * param_4 := obj.GetMin();\n */\n```
['Go']