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

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/reconstruct-itinerary/ ### 报错信息 超出时间限制 通过测试用例80/81 这道题疑似是加强了用例 ### 你是否愿意提交 PR 修复这个 bug? - [X] 我愿意!

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://labuladong.github.io/algo/di-yi-zhan-da78c/shou-ba-sh-daeca/suan-fa-ji-8674e/ ### 报错信息 146 题 LRU 缓存 C++ 版本的解法错误, 因为C++ 中的 unordered_map是无序的导致错误 ### 你是否愿意提交 PR 修复这个 bug? - [...

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.com/problems/balanced-binary-tree/ ### 报错信息 不知道是不是我对二叉树的基础概念有误,这道题您在解答的时候,计算每一个节点的最大深度(depth), 这边的depth 是height的意思吗?因为Height 和Depth是两个不同的概念,所以我有一点疑惑,虽然这只是function 名字的问题。 第二个问题是您的base condition ``` if (root == null) { return 0; }...

help wanted

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/ ### 报错信息 该代码可以正常运行,但是我斗胆猜测东哥没有想这么写,代码是我在算法笔记一书中看到的。 bug出现在循环外的返回判断处:if(left-1=nums.size()),左边是有符号数,右边是无符号数,当测试用例为nums:[1],target=0时,代码正常来讲运行到该语句,left应为0,则left-1>=nums.size()就应该是-1>=1,为false,但由于整形提升,有符号数转为无符号数,导致代码走向了非预期的if语句块中:return -1; 代码如下: `int right_bound(vector& nums, int target) { int left = 0, right =...

help wanted

應該 `buy` 必须在 `sell` 之`前`...?

### 请在提交 bug 之前先搜索 - [X] 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 ### 出错的题目链接 https://leetcode.cn/problems/lru-cache/description/ ### 报错信息 样例有一个过不去 ### 你是否愿意提交 PR 修复这个 bug? - [X] 我愿意!

help wanted

Fixes #1425 我修改的是如下题目的 python 解法: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/ 通过截图如下:

Currently the english version is available only on light mode, it would be greatly appreciated if you could enable the toggle for the English version. Its available starting from free...

English Terminology should be Hash collision https://en.wikipedia.org/wiki/Hash_collision

修正了语法错误:“下面都会画的图都是二叉树结构”。 ```diff - 为了方便讲解,下面都会画的图都是二叉树结构,相信你能把树和数组对应起来。 + 为了方便讲解,下面的图示都将采用二叉树结构,希望能够帮助你将树和数组进行对应。 ```