mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update stack_II.py
This commit is contained in:
parent
975b4d7dbd
commit
a079cef3d2
@ -11,7 +11,7 @@ class Stack:
|
||||
|
||||
def push(self, val: int) -> None:
|
||||
self.stack.append((val, self.min))
|
||||
if self.min != None:
|
||||
if self.min is not None:
|
||||
self.min = min(self.min, val)
|
||||
else:
|
||||
self.min = val
|
||||
@ -30,7 +30,7 @@ class Stack:
|
||||
|
||||
return False
|
||||
|
||||
def getMin(self) -> int:
|
||||
def get_min(self) -> int:
|
||||
if self.stack:
|
||||
return self.min
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user