leetcode-extension icon indicating copy to clipboard operation
leetcode-extension copied to clipboard

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

Open 578223592 opened this issue 1 year ago • 1 comments

🐛 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

578223592 avatar Mar 04 '24 04:03 578223592

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

ccagml avatar Mar 09 '24 15:03 ccagml