Skip to content

Commit ddc777a

Browse files
committed
Update all solutions' changes in 2025-06-15.
1 parent 78f8a2c commit ddc777a

34 files changed

+869
-35
lines changed

en/1-1000/1-two-sum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Solution:
116116
1. In `Map`, `key` is `num`, and `value` is array `index`.
117117
2. Traverse the array, if `target - num` is in `Map`, return it. Otherwise, add `num` to `Map`.
118118

119-
## Step by Step Solutions
119+
## Step-by-Step Solution
120120

121121
1. In `Map`, `key` is `num`, and `value` is array `index`.
122122

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Notice that the order of the output and the order of the triplets does not matte
8282
4. If you choose `option 1`, you need to use the `two pointers` algorithm when searching for the other two numbers.
8383
5. For `option 2`, only the `Python` sample code is given. This article focuses on `option 1`.
8484

85-
## Step by Step Solutions
85+
## Step-by-Step Solution
8686

8787
1. Sort `nums`.
8888
2. Iterate over `nums`.

en/1-1000/151-reverse-words-in-a-string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Return *a string of the words in reverse order concatenated by a single space*.
4848
2. Reverse the order of the words
4949
3. Join the words with a single space
5050

51-
## Step by Step Solutions
51+
## Step-by-Step Solution
5252

5353
1. Split the string using `split(' ')`
5454
2. Remove empty strings

en/1-1000/160-intersection-of-two-linked-lists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ You must first calculate how many kilometers her home is farther from the school
6666
3. At this time, repeat `node = node.next` on the two linked lists until the same node is found or one of the linked lists has reached the end.
6767
</p></details>
6868

69-
## Step by Step Solutions
69+
## Step-by-Step Solution
7070

7171
1. First calculate the number of nodes in the two linked lists A and B. The number of nodes in linked list A is `node_count_a`, and the number of nodes in linked list B is `node_count_b`.
7272

en/1-1000/19-remove-nth-node-from-end-of-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Given the `head` of a linked list, remove the *n<sup>th</sup>* node from the end
5151
3. When `index == node_count - n`, delete the node by `node.next = node.next.next`.
5252
4. Since the deleted node may be `head`, a virtual node `dummy_node` is used to facilitate unified processing.
5353

54-
## Step by Step Solutions
54+
## Step-by-Step Solution
5555

5656
1. First find out `node_count`.
5757

en/1-1000/202-happy-number.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Return `true` if `n` is *a happy number*, and `false` if not.
4646
2. If `n` has already appeared, it means that the loop has been entered, and `return false`. You can use `Set` to save the `n` that has appeared.
4747
3. Go is the iterative solution, other languages are the recursive solution.
4848

49-
## Step by Step Solutions
49+
## Step-by-Step Solution
5050

5151
1. Generate a new `n` as the `isHappy(n)` parameter.
5252

en/1-1000/206-reverse-linked-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Given the `head` of a singly linked list, reverse the list, and return _the reve
4545

4646
<details><summary>Click to view the answer</summary><p>It is `while (current != null)`, because the operation to be performed is `current.next = previous`.</p></details>
4747

48-
## Step by Step Solutions
48+
## Step-by-Step Solution
4949

5050
1. Traverse all nodes.
5151

en/1-1000/209-minimum-size-subarray-sum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Given an array of positive integers `nums` and a positive integer `target`, retu
4545

4646
For **subarray** problems, you can consider using **Sliding Window Technique**, which is similar to the **Fast & Slow Pointers Approach**.
4747

48-
## Step by Step Solutions
48+
## Step-by-Step Solution
4949

5050
1. Iterate over the `nums` array, the `index` of the element is named `fastIndex`. Although inconspicuous, this is the most important logic of the *Fast & Slow Pointers Approach*. Please memorize it.
5151

en/1-1000/238-product-of-array-except-self.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You must write an algorithm that runs in `O(n)` time and **without using the div
6868
- **High-frequency computation problems**: Such as Fibonacci sequences, factorials, prime number tables, etc., which avoid repetitive calculations by pre-generating lookup tables.
6969
- **Dynamic Programming (DP)**: Pre-computing and storing solutions to sub-problems, e.g., the `knapsack problem` or `shortest path problems`.
7070

71-
## Step by Step Solutions
71+
## Step-by-Step Solution
7272

7373
1. **Initialize Arrays**:
7474
- Create a `leftProducts` array to store the product of all elements to the left of each element
@@ -315,7 +315,7 @@ func productExceptSelf(nums []int) []int {
315315
2. **Two-Phase Calculation**: First compute left products and store in the result, then dynamically compute right products and merge directly
316316
3. **In-Place Operation**: Use only a single variable to dynamically maintain the right product
317317

318-
## Step by Step Solutions
318+
## Step-by-Step Solution
319319

320320
1. **Initialize Result Array**:
321321
- Create an `answer` array of the same size, initialized with all 1s

en/1-1000/24-swap-nodes-in-pairs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Before solving this problem, it is recommended to solve the simple problem [206.
4646
1. To solve this problem, you still need to define at least two variables: `current` and `previous`.
4747
2. The loop condition should be `while (current.next != null)` instead of `while (current != null)`, because the operations that need to be performed include `current.next.next`.
4848

49-
## Step by Step Solutions
49+
## Step-by-Step Solution
5050

5151
1. Traverse all nodes.
5252

0 commit comments

Comments
 (0)