mirror of
https://github.com/labuladong/fucking-algorithm.git
synced 2025-07-04 11:22:59 +08:00
add multi lang code
This commit is contained in:
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<!--
|
||||
如果你是在修复刷题插件的解法代码,请务必保证你的代码是可运行的,否则我们将不会合并你的代码。
|
||||
|
||||
|
||||
-->
|
69901
多语言解法代码/solution_code.md
Normal file
69901
多语言解法代码/solution_code.md
Normal file
File diff suppressed because it is too large
Load Diff
60
多语言解法代码/修复指南.md
Normal file
60
多语言解法代码/修复指南.md
Normal file
@ -0,0 +1,60 @@
|
||||
# 修正 labuladong 刷题插件中的错误
|
||||
|
||||
首先,感谢你愿意为我的插件提供的解法代码纠错,你按照下面的步骤提交 PR 修复错误后,你将成为本仓库的 contributor,出现在仓库首页的贡献者列表中。本仓库已经获得了 115k+ star,你的贡献将会被许多人看到。
|
||||
|
||||
修复代码很简单,所有多语言解法代码都存储在 [solution_code.md](./solution_code.md) 中,你只要修改这个文件就行了。其内容的组织形如如下:
|
||||
|
||||
|
||||
https://leetcode.cn/problems/xxx 的多语言解法👇
|
||||
|
||||
```cpp
|
||||
class Solution {
|
||||
public:
|
||||
int xxx() {
|
||||
// ...
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```java
|
||||
class Solution {
|
||||
public int xxx() {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```python
|
||||
class Solution:
|
||||
def xxx(self):
|
||||
# ...
|
||||
```
|
||||
|
||||
```javascript
|
||||
var xxx = function() {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
func xxx() {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
https://leetcode.cn/problems/xxx 的多语言解法👆
|
||||
|
||||
|
||||
比如你想修改 [https://leetcode-cn.com/problems/longest-palindromic-substring/](https://leetcode-cn.com/problems/longest-palindromic-substring/) 的多语言解法,你可以在 [solution_code.md](./solution_code.md) 中搜索 `longest-palindromic-substring`,即可找到这道题的多语言解法,然后修改这个文件,提交 PR 即可。
|
||||
|
||||
我的插件会自动拉取这个文件的最新内容,所以你的 PR 被合进 master 分支后,插件中的内容修改也会生效。
|
||||
|
||||
## 提交 PR 的要求
|
||||
|
||||
1、你的 PR 必须是针对 [solution_code.md](./solution_code.md) 文件中代码部分的修改,不要修改其他文件和其他内容。
|
||||
|
||||
2、把我的解法翻译成多语言的目的是帮助不同背景的小伙伴理解算法思维,所以你修改的代码可以不是效率最优的,但应该尽可能和我的解法思路保持一致,且包含我的解法中的完整注释。
|
||||
|
||||
3、你的 PR 需要包含截图,截图中必须包含你修改的代码在 leetcode-cn.com 上的运行结果,否则 PR 会被拒绝。
|
||||
|
||||
以上几点
|
Reference in New Issue
Block a user