Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report for minimum-stack #3996

Open
tuanpnguyen opened this issue Apr 4, 2025 · 0 comments
Open

Bug Report for minimum-stack #3996

tuanpnguyen opened this issue Apr 4, 2025 · 0 comments

Comments

@tuanpnguyen
Copy link

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.?title=Bug Report for evaluate-reverse-polish-notation

This is not working (1)

public void pop() {
    if(stack.empty()) {
        return;
    }
   int top = stack.peek();
    if (stack.peek() == min.peek()) {
        min.pop();
    }
    stack.pop();


}

This is working

public void pop() {
    if(stack.empty()) {
        return;
    }
   int top = stack.peek();
    if (top == min.peek()) {
        min.pop();
    }
    stack.pop();


}

This may not be a bug but as I think the two function should return the same result. Can you check? As always, thanks and appreciate all the works of you and your team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant