Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug Report for minimum-stack #3956

Closed
Closed
@salmanh123

Description

@salmanh123

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

Image

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

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp