labuladong / fucking-algorithm

刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.

Home Page:https://labuladong.github.io/algo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug][python] open-the-lock/description

LzMingYueShanPao opened this issue · comments

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/open-the-lock/description/

报错信息

TypeError: Solution.plusOne() takes 2 positional arguments but 3 were given
^^^^^^^^^^^^^^^^^^^^
up = self.plusOne(cur, j)
Line 20 in openLock (Solution.py)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ret = Solution().openLock(param_1, param_2)
Line 71 in _driver (Solution.py)
_driver()
Line 82 in (Solution.py)

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!

应该为plusOne()和minusOne()方法的形参添加self,并在调用时使用self.plusOne()和self.minusOne()的形式调用