fucking-algorithm icon indicating copy to clipboard operation
fucking-algorithm copied to clipboard

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

Results 336 fucking-algorithm issues
Sort by recently updated
recently updated
newest added

- make go code more readable. - add comments. 我修改的是如下题目的 golang 解法: https://leetcode.com/problems/fibonacci-number 通过截图如下:

- make go code more readable. - add comments. 我修改的是如下题目的 golang 解法: https://leetcode.com/problems/diameter-of-binary-tree 通过截图如下:

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/description/ ### 报错信息 test通过不了 ### 你是否愿意提交 PR 修复这个 bug? - [ ] 我愿意!

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/permutations-ii/ ### 报错信息 在文章[回溯算法秒杀所有排列/组合/子集问题 - 排列-元素可重不可复选](https://labuladong.online/algo/essential-technique/permutation-combination-subset-all-in-one/#%E6%8E%92%E5%88%97-%E5%85%83%E7%B4%A0%E5%8F%AF%E9%87%8D%E4%B8%8D%E5%8F%AF%E5%A4%8D%E9%80%89)中,提到了一种**剪枝思路**,javascript代码部分如下图: ![image](https://github.com/labuladong/fucking-algorithm/assets/161050006/fb95c026-974f-4d4f-9229-1f711f12ed87) 如果完全按照示例编写代码会有问题,报错信息如下 ```js 输入 nums = [1,1,2] 输出 [[1,2,1]] 预期结果 [[1,1,2],[1,2,1],[2,1,1]] ``` 其中的preNum定义需要放在backTrack函数中,如果放在外层...

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.com/problems/minimum-height-trees/description/ ### 报错信息 1. 编译报错 For Loop 之后缺少 leaves = newLeaves 这一行 2. For Loop 需要使用 Boxed Type 不能使用...

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 idea 兼容 ### 报错信息 ``` com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.shuzijun.leetcode.plugin.actions.editor.EditorMenuActionGroup' must override `getActionUpdateThread`...

help wanted

- Consistent with the function signature on LeetCode ``` func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode { } ``` - More in line with Go's coding conventions, and also more consistent...

- Define the `pq` variable as a pointer to simplify the syntax and make it easier for the reader to understand. - Replace `interface{}` with `any`, although they are equivalent,...

- make go code more readable. - add comments. 我修改的是如下题目的 golang 解法: https://leetcode.com/problems/linked-list-cycle-ii 通过截图如下:

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/3sum/description/ ### 报错信息 第一章:一个方法团灭nSum问题 twoSumTarget方法代码中使用res.add(Arrays.asList(left, right))。asList方法生成的list容量固定。threeSumTarget方法中直接对该list使用add方法报错。leetCode官网的解法代码没有问题,使用res.add(new ArrayList(Arrays.asList(left, right))); ### 你是否愿意提交 PR 修复这个 bug? - [X] 我愿意!

help wanted