AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
39
var assert = require('assert');
class MinStack {
constructor() {}
push(val) {}
pop() {}
peek() {}
min() {}
}
try {
var minstack = new MinStack();
minstack.push(4);
minstack.push(7);
minstack.push(3);
minstack.push(2);
minstack.push(6);
var min1 = minstack.min();
minstack.pop();
var min2 = minstack.min();
minstack.pop();
var min3 = minstack.min();
minstack.pop();
OUTPUT
Results will appear here.