Skip to content

Commit a1f980e

Browse files
committed
docs: sync problem 15 with original content from leetcoder.net
1 parent 8bcc39c commit a1f980e

File tree

2 files changed

+13
-69
lines changed

2 files changed

+13
-69
lines changed

en/1-1000/15-3sum.md

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# 15. 3Sum - Best Practices of LeetCode Solutions
2-
LeetCode link: [15. 3Sum](https://leetcode.com/problems/3sum), difficulty: **Medium**
1+
Original link: [leetcoder.net - LeetCoder: Fucking Good LeetCode Solutions](https://leetcoder.net/en/leetcode/15-3sum)
2+
3+
# 15. 3Sum - LeetCoder: Fucking Good LeetCode Solutions
4+
LeetCode link: [15. 3Sum](https://leetcode.com/problems/3sum), Difficulty: **Medium**.
35

46
## LeetCode description of "15. 3Sum"
57
Given an integer array nums, return all the triplets `[nums[i], nums[j], nums[k]]` such that `i != j`, `i != k`, and `j != k`, and `nums[i] + nums[j] + nums[k] == 0`.
@@ -85,8 +87,8 @@ Notice that the order of the output and the order of the triplets does not matte
8587
```
8688

8789
## Complexity
88-
* Time: `O(N * N)`.
89-
* Space: `O(N)`.
90+
- Time complexity: `O(N * N)`.
91+
- Space complexity: `O(N)`.
9092

9193
## Python
9294
### Solution 1: Use Map (complex and slow)
@@ -164,37 +166,7 @@ class Solution:
164166
return list(results)
165167
```
166168

167-
## C++
168-
```cpp
169-
// Welcome to create a PR to complete the code of this language, thanks!
170-
```
171-
172-
## Java
169+
## Other languages
173170
```java
174171
// Welcome to create a PR to complete the code of this language, thanks!
175172
```
176-
177-
## JavaScript
178-
```javascript
179-
// Welcome to create a PR to complete the code of this language, thanks!
180-
```
181-
182-
## C#
183-
```c#
184-
// Welcome to create a PR to complete the code of this language, thanks!
185-
```
186-
187-
## Go
188-
```go
189-
// Welcome to create a PR to complete the code of this language, thanks!
190-
```
191-
192-
## Ruby
193-
```ruby
194-
# Welcome to create a PR to complete the code of this language, thanks!
195-
```
196-
197-
## C, Kotlin, Swift, Rust or other languages
198-
```
199-
// Welcome to create a PR to complete the code of this language, thanks!
200-
```

zh/1-1000/15-3sum.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
原文链接:[leetcoder.net - 力扣题解最佳实践](https://leetcoder.net/zh/leetcode/15-3sum)
2+
13
# 15. 三数之和 - 力扣题解最佳实践
24
力扣链接:[15. 三数之和](https://leetcode.cn/problems/3sum) ,难度:**中等**
35

4-
## 力扣15. 三数之和问题描述
6+
## 力扣"15. 三数之和"问题描述
57
给你一个整数数组 `nums` ,判断是否存在三元组 `[nums[i], nums[j], nums[k]]` 满足 `i != j``i != k``j != k` ,同时还满足 `nums[i] + nums[j] + nums[k] == 0` 。请你返回所有和为 `0` 且不重复的三元组。
68

79
**注意**:答案中****可以包含**重复**的三元组。
@@ -82,8 +84,8 @@ nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0 。
8284
```
8385

8486
## 复杂度
85-
* 时间:`O(N * N)`
86-
* 空间:`O(N)`
87+
- 时间:`O(N * N)`
88+
- 空间:`O(N)`
8789

8890
## Python
8991
### Solution 1: Use Map (complex and slow)
@@ -160,37 +162,7 @@ class Solution:
160162
return list(results)
161163
```
162164

163-
## C++
164-
```cpp
165-
// Welcome to create a PR to complete the code of this language, thanks!
166-
```
167-
168-
## Java
165+
## 其他语言
169166
```java
170167
// Welcome to create a PR to complete the code of this language, thanks!
171168
```
172-
173-
## JavaScript
174-
```javascript
175-
// Welcome to create a PR to complete the code of this language, thanks!
176-
```
177-
178-
## C#
179-
```c#
180-
// Welcome to create a PR to complete the code of this language, thanks!
181-
```
182-
183-
## Go
184-
```go
185-
// Welcome to create a PR to complete the code of this language, thanks!
186-
```
187-
188-
## Ruby
189-
```ruby
190-
# Welcome to create a PR to complete the code of this language, thanks!
191-
```
192-
193-
## C, Kotlin, Swift, Rust or other languages
194-
```
195-
// Welcome to create a PR to complete the code of this language, thanks!
196-
```

0 commit comments

Comments
 (0)