Skip to content

Commit b8f3061

Browse files
committed
fix: update
1 parent b7603bb commit b8f3061

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

solution/2600-2699/2674.Split a Circular Linked List/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tags:
4646
<p><strong>提示:</strong></p>
4747

4848
<ul>
49-
<li><code>list</code> 中的节点数范围为 <code>[2, 105]</code></li>
49+
<li><code>list</code> 中的节点数范围为 <code>[2, 10<sup>5</sup>]</code></li>
5050
<li><code>0 &lt;= Node.val &lt;= 10<sup>9</sup></code></li>
5151
<li><code>LastNode.next = FirstNode</code> ,其中 <code>LastNode</code> 是链表的最后一个节点,<code>FirstNode</code> 是第一个节点。</li>
5252
</ul>

solution/3400-3499/3442.Maximum Difference Between Even and Odd Frequency I/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3442.Ma
7171

7272
<!-- solution:start -->
7373

74-
### 方法一
74+
### 方法一:计数
75+
76+
我们可以用一个哈希表或数组 $\textit{cnt}$ 记录字符串 $s$ 中每个字符的出现次数。然后遍历 $\textit{cnt}$,找出出现奇数次的字符的最大频次 $a$ 和出现偶数次的字符的最小频次 $b$,最后返回 $a - b$ 即可。
77+
78+
时间复杂度 $O(n)$,其中 $n$ 是字符串 $s$ 的长度。空间复杂度 $O(|\Sigma|)$,其中 $\Sigma$ 是字符集,本题中 $|\Sigma| = 26$。
7579

7680
<!-- tabs:start -->
7781

solution/3400-3499/3442.Maximum Difference Between Even and Odd Frequency I/README_EN.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3442.Ma
6969

7070
<!-- solution:start -->
7171

72-
### Solution 1
72+
### Solution 1: Counting
73+
74+
We can use a hash table or an array $\textit{cnt}$ to record the occurrences of each character in the string $s$. Then, we traverse $\textit{cnt}$ to find the maximum frequency $a$ of characters that appear an odd number of times and the minimum frequency $b$ of characters that appear an even number of times. Finally, we return $a - b$.
75+
76+
The time complexity is $O(n)$, where $n$ is the length of the string $s$. The space complexity is $O(|\Sigma|)$, where $\Sigma$ is the character set. In this problem, $|\Sigma| = 26$.
7377

7478
<!-- tabs:start -->
7579

0 commit comments

Comments
 (0)