MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / pop

Method pop

stacks/min-stack.js:16–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
28const myMinStack = new MinStack();

Callers 15

combinationHelperFunction · 0.45
listOfDepthsFunction · 0.45
isSameTreeFunction · 0.45
symmetricalTreeFunction · 0.45
nodeDepthsFunction · 0.45
validateBstFunction · 0.45
traverseNodeFunction · 0.45
getOrderedJobsFunction · 0.45
validPathFunction · 0.45
routeBetweenNodesFunction · 0.45
removeMethod · 0.45
dfsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected