- Notifications
You must be signed in to change notification settings - Fork2.4k
Closed
Description
Bug Report forhttps://neetcode.io/problems/minimum-stack
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
My answer rejected in your online leetcode-esque IDE but leetcode accepts my answer this is the solution I provided
class MinStack:
def __init__(self): self.minStack = [] def push(self, val: int) -> None: # check if self.minStack == []: self.minStack.append([val,val]) else: self.minStack.append([val, min(self.getMin(), val)])def pop(self) -> None: return self.minStack.pop()[0] def top(self) -> int: return self.minStack[-1][0] def getMin(self) -> int: return self.minStack[-1][1]
This is leetcodes
Metadata
Metadata
Assignees
Labels
No labels