Update and rename stack_II.py to stack.py

This commit is contained in:
marina 2023-08-07 17:58:03 -07:00 committed by GitHub
parent 27bc931a53
commit 6ed5cb896b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,17 +22,10 @@ class Stack:
self.min = prior_min
return val
return False
def top(self) -> int:
if self.stack:
return self.stack[-1][0]
return False
def get_min(self) -> int:
if self.stack:
return self.min
return self.min
return False