fucking-algorithm
fucking-algorithm copied to clipboard
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.
### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.com/problems/n-queens/ ### 报错信息 Wrong Answer Runtime: 49 ms Case 1 Case 2 Input n = 4 Output [[[".","Q",".","."],[".",".",".","Q"],["Q",".",".","."],[".",".","Q","."]],[[".",".","Q","."],["Q",".",".","."],[".",".",".","Q"],[".","Q",".","."]]] Expected...
### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.com/problems/serialize-and-deserialize-binary-tree/ ### 报错信息 Runtime Error AttributeError: 'NoneType' object has no attribute 'append' sb.append(str(root.val)).append(self.SEP) Line 28 in _serialize (Solution.py) self._serialize(root,...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/ ### 报错信息 ``` Line 2: panic: runtime error: slice bounds out of range...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/zui-xiao-de-kge-shu-lcof/ ### 报错信息 ``` Line 24: SyntaxError: Identifier 'PriorityQueue' has already been declared Line...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/zui-xiao-de-kge-shu-lcof/ ### 报错信息 ``` Line 43: Char 6: getLeastNumbers redeclared in this block (solution.go)...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/ ### 报错信息 ``` Line 4: IndentationError: expected an indented block after function definition...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/ ### 报错信息 ``` Line 7: Char 1: missing return (solution.go) ``` ### 你是否愿意提交...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/ ### 报错信息 ``` Line 13: Char 5: error: non-void function does not return...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/xu-lie-hua-er-cha-shu-lcof/ ### 报错信息 ``` Line 14: Char 36: undefined: TreeNode (solution.go) ``` ### 你是否愿意提交...
此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:https://github.com/labuladong/fucking-algorithm/issues/1113 ### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/ ### 报错信息 ``` Line 9: ReferenceError: findNthDigit_100 is not defined Line 9 in...