javascript solution beats 100% submission
\nvar MinStack = function() {\n  this.elements = [];\n};\n\n/**\n\n @param {number} x\n @return {void}\n */\nMinStack.prototype.push = function(x) {\n  this.ele
```\nvar MinStack = function() {\n  this.elements = [];\n};\n\n/**\n\n @param {number} x\n @return {void}\n */\nMinStack.prototype.push = function(x) {\n  this.elements.push({\n    value: x,\n    min: this.elements.length === 0 ? x : Math.min(x, this.getMin()),\n  });\n};\n/**\n\n @return {void}\n */\nMinStack.prototype.pop = function() {\n  this.elements.pop();\n};\n/**\n\n @return {number}\n */\nMinStack.prototype.top = function() {\n  return this.elements[this.elements.length - 1].value;\n};\n/**\n\n @return {number}\n */\nMinStack.prototype.getMin = function() {\n  return this.elements[this.elements.length - 1].min;\n};\n```
['JavaScript']