Skip to content

Commit ebacdf3

Browse files
committed
docs: update solutions
1 parent 882ce04 commit ebacdf3

File tree

104 files changed

+150
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+150
-132
lines changed

solution/0000-0099/0001.Two Sum/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
## Solutions
5050

51-
**Approach 1: Hash Table**
51+
**Solution 1: Hash Table**
5252

5353
We can use the hash table $m$ to store the array value and the corresponding subscript.
5454

solution/0000-0099/0002.Add Two Numbers/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
## Solutions
4444

45-
**Approach 1: Simulation**
45+
**Solution 1: Simulation**
4646

4747
We traverse two linked lists $l_1$ and $l_2$ at the same time, and use the variable $carry$ to indicate whether there is a carry.
4848

solution/0000-0099/0003.Longest Substring Without Repeating Characters/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Notice that the answer must be a substring, "pwke" is a subsequence an
4242

4343
## Solutions
4444

45-
**Approach 1: Two pointers + Hash Table**
45+
**Solution 1: Two pointers + Hash Table**
4646

4747
Define a hash table to record the characters in the current window. Let $i$ and $j$ represent the start and end positions of the non-repeating substring, respectively. The length of the longest non-repeating substring is recorded by `ans`.
4848

solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
## Solutions
3434

35-
**Approach 1: Dynamic Programming**
35+
**Solution 1: Dynamic Programming**
3636

3737
Set $dp[i][j]$ to indicate whether the string $s[i..j]$ is a palindrome.
3838

@@ -41,7 +41,7 @@ Set $dp[i][j]$ to indicate whether the string $s[i..j]$ is a palindrome.
4141

4242
The time complexity is $O(n^2)$ and the space complexity is $O(n^2)$. Where $n$ is the length of the string $s$.
4343

44-
**Approach 2: Enumerate the Palindrome Center**
44+
**Solution 2: Enumerate the Palindrome Center**
4545

4646
We can enumerate the palindrome center, spread to both sides, and find the longest palindrome.
4747

solution/0000-0099/0006.Zigzag Conversion/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ P I
5858

5959
## Solutions
6060

61-
**Approach 1: Simulation**
61+
**Solution 1: Simulation**
6262

6363
We use a 2D array $g$ to simulate the process of the $Z$-shaped arrangement, where $g[i][j]$ represents the character in the $i$th row and the $j$th column. Initially, $i=0$, and we also define a direction variable $k$, initially $k=-1$, which means up.
6464

solution/0000-0099/0007.Reverse Integer/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
## Solutions
4141

42-
**Approach 1: Mathematical**
42+
**Solution 1: Mathematical**
4343

4444
Let $mi$ and $mx$ be $-2^{31}$ and $2^{31} - 1$ respectively. The reversed result $ans$ needs to satisfy $mi \le ans \le mx$.
4545

solution/0000-0099/0012.Integer to Roman/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ M 1000</pre>
6262

6363
## Solutions
6464

65-
**Approach 1: Greedy**
65+
**Solution 1: Greedy**
6666

6767
We can list all possible symbols $cs$ and corresponding values $vs$ first, then enumerate the value $vs[i]$ from large to small, and use the symbol $cs[i]$ as much as possible each time until the number $num$ becomes $0$.
6868

solution/0000-0099/0013.Roman to Integer/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ M 1000</pre>
6464

6565
## Solutions
6666

67-
**Approach 1: Hash table + simulation**
67+
**Solution 1: Hash table + simulation**
6868

6969
We first use a hash table $d$ to record the numerical value corresponding to each character, and then traverse the string $s$ from left to right. If the numerical value corresponding to the current character is less than the numerical value corresponding to the right character, subtract the numerical value corresponding to the current character, otherwise add the numerical value corresponding to the current character.
7070

solution/0000-0099/0014.Longest Common Prefix/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
## Solutions
3737

38-
**Approach 1: Character Comparison**
38+
**Solution 1: Character Comparison**
3939

4040
We take the first string $strs[0]$ as the benchmark, and compare the $i$th character of the string after it with the $i$th character of $strs[0]$. If it is the same, continue to compare the next character, otherwise return the first $i$ characters of $strs[0]$.
4141

solution/0000-0099/0015.3Sum/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Notice that the order of the output and the order of the triplets does not matte
4848

4949
## Solutions
5050

51-
**Approach 1: Sort + Two Pointers**
51+
**Solution 1: Sort + Two Pointers**
5252

5353
We notice that the problem does not require us to return the triplet in order, so we might as well sort the array first, which makes it easy to skip duplicate elements.
5454

0 commit comments

Comments
 (0)