Skip to content

题目155,测试case出现testcase has incorrect number of arguments (expected 2, got 1) #302

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

Open
578223592 opened this issue Mar 4, 2024 · 1 comment

Comments

@578223592
Copy link

🐛 Bug Report(错误报告)

题目155,测试case出现:
image
在网页上没问题

To Reproduce(重现)

语言:cpp
代码:

// 参考:https://leetcode.cn/problems/min-stack/solutions/242861/zui-yi-dong-yi-ge-zhan-tong-shi-bao-cun-dang-qian-/
// 额外保存包含当前元素的时候栈内最小元素即可
class MinStack
{
    class Node
    {
    private:
        /* data */
    public:
        int val, preMin;
    };

public:
    stack<Node> stk_;
    MinStack()
    {
    }

    void push(int val)
    {
        Node node;
        node.val = val;
        node.preMin = node.val;
        if (!stk_.empty())
        {
            node.preMin = min({stk_.top().preMin, node.preMin});
        }
        stk_.push(node);
    }

    void
    pop()
    {
        stk_.pop();
    }

    int top()
    {
        return stk_.top().val;
    }

    int getMin()
    {
        return stk_.top().preMin;
    }
};

Expected behavior(预期行为)

A clear and concise description of what you expected to happen.(对您期望发生的事情进行清晰简洁的描述。)

Extension Output(扩展输出)

Paste here the LeetCode extension log from output channel.(将输出通道中的 LeetCode 扩展日志粘贴到此处。)

Guidance: Press Ctrl+Shift+U, and toggle the channel to LeetCode.(按Ctrl+Shift+U,将频道切换到LeetCode。)

Your Environment

  • os(操作系统):win11
  • extension settings(扩展设置):
  • nodejs version(nodejs 版本):
  • vscode version(vscode 版本):最新
  • extension version(扩展版本):v3.1.18
@ccagml
Copy link
Owner

ccagml commented Mar 9, 2024

看起来是155题目给的示例格式跟大部分题目不一样

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

2 participants