MCPcopy
hub / github.com/HuberTRoy/leetCode / push

Method push

Stack/GetMinStack.py:65–73  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

63 self.minStack = Stack()
64
65 def push(self, value):
66 super().push(value)
67 if self.minStack.empty():
68 self.minStack.push(value)
69 else:
70 if self.minStack.get_top() <= value:
71 self.minStack.push(self.minStack.get_top())
72 else:
73 self.minStack.push(value)
74
75 def pop(self):
76 super().pop()

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
get_topMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected