My Python solution
class MinStack:\n    \n    def __init__(self):\n        self.q = []\n\n    # @param x, an integer\n    # @return an integer\n    def push(self, x):\n        cur
    class MinStack:\n    \n    def __init__(self):\n        self.q = []\n\n    # @param x, an integer\n    # @return an integer\n    def push(self, x):\n        curMin = self.getMin()\n        if curMin == None or x < curMin:\n            curMin = x\n        self.q.append((x, curMin));\n\n    # @return nothing\n    def pop(self):\n        self.q.pop()\n\n\n    # @return an integer\n    def top(self):\n        if len(self.q) == 0:\n            return None\n        else:\n            return self.q[len(self.q) - 1][0]\n\n\n    # @return an integer\n    def getMin(self):\n        if len(self.q) == 0:\n            return None\n        else:\n            return self.q[len(self.q) - 1][1]
[]