()
| 14 | } |
| 15 | |
| 16 | pop() { |
| 17 | if (this.elements.length > 0) { |
| 18 | const elementToPop = this.elements.pop(); |
| 19 | if (elementToPop === this.min) { |
| 20 | this.mins.pop(); |
| 21 | this.min = this.mins[this.mins.length - 1]; |
| 22 | } |
| 23 | return elementToPop; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | const myMinStack = new MinStack(); |
no outgoing calls
no test coverage detected