MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / push

Method push

python/0155-min-stack.py:6–9  ·  view source on GitHub ↗
(self, val: int)

Source from the content-addressed store, hash-verified

4 self.minStack = []
5
6 def push(self, val: int) -> None:
7 self.stack.append(val)
8 val = min(val, self.minStack[-1] if self.minStack else val)
9 self.minStack.append(val)
10
11 def pop(self) -> None:
12 self.stack.pop()

Callers 3

createProblemsObjFunction · 0.45
nestedFilesFunction · 0.45

Calls 1

minFunction · 0.50

Tested by

no test coverage detected