-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Bug Report for https://neetcode.io/problems/minimum-stack
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Hi again! Here's my implementation of the MinStack class:
private final List<Integer> stackList;
public MinStack() {
stackList = new ArrayList<>();
}
public void push(int val) {
stackList.add(val);
}
public void pop() {
stackList.remove(stackList.size() - 1);
}
public int top() {
return stackList.get(stackList.size() - 1);
}
public int getMin() {
return stackList.get(0);
}
The result from an external IDE, following the same steps described in the test case, is as follows:
[1,2,1]
And from your IDE is as follows:
[0,2,1]
I don't know how your validator works, but it seems it's not validating correctly.
Metadata
Metadata
Assignees
Labels
No labels