Skip to content

Commit b00ef57

Browse files
committed
feat: update lc problems
1 parent 4cc289a commit b00ef57

File tree

24 files changed

+354
-145
lines changed

24 files changed

+354
-145
lines changed

solution/0100-0199/0150.Evaluate Reverse Polish Notation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ul>
1616
<li>有效的算符为 <code>'+'</code>、<code>'-'</code>、<code>'*'</code> 和 <code>'/'</code> 。</li>
1717
<li>每个操作数(运算对象)都可以是一个整数或者另一个表达式。</li>
18-
<li>两个整数之间的乘法总是 <strong>向零截断</strong> 。</li>
18+
<li>两个整数之间的除法总是 <strong>向零截断</strong> 。</li>
1919
<li>表达式中不含除零运算。</li>
2020
<li>输入是一个根据逆波兰表示法表示的算术表达式。</li>
2121
<li>答案及所有中间计算结果可以用 <strong>32 位</strong> 整数表示。</li>

solution/0100-0199/0175.Combine Two Tables/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ addressId 是该表的主键列。
3737
该表的每一行都包含一个 ID = PersonId 的人的城市和州的信息。
3838
</pre>
3939

40-
<p>&nbsp;</p>
41-
4240
<p>编写一个SQL查询来报告 <code>Person</code> 表中每个人的姓、名、城市和州。如果 <code>personId</code> 的地址不在&nbsp;<code>Address</code>&nbsp;表中,则报告为空 &nbsp;<code>null</code>&nbsp;。</p>
4341

4442
<p>以 <strong>任意顺序</strong> 返回结果表。</p>

solution/1100-1199/1106.Parsing A Boolean Expression/README.md

+28-24
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,56 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给你一个以字符串形式表述的&nbsp;<a href="https://baike.baidu.com/item/%E5%B8%83%E5%B0%94%E8%A1%A8%E8%BE%BE%E5%BC%8F/1574380?fr=aladdin" target="_blank">布尔表达式</a>(boolean) <code>expression</code>,返回该式的运算结果。</p>
10-
119
<p>有效的表达式需遵循以下约定:</p>
1210

1311
<ul>
14-
<li><code>&quot;t&quot;</code>,运算结果为 <code>True</code></li>
15-
<li><code>&quot;f&quot;</code>,运算结果为 <code>False</code></li>
16-
<li><code>&quot;!(expr)&quot;</code>,运算过程为对内部表达式 <code>expr</code> 进行逻辑 <strong>非的运算</strong>(NOT)</li>
17-
<li><code>&quot;&amp;(expr1,expr2,...)&quot;</code>,运算过程为对 2 个或以上内部表达式 <code>expr1, expr2, ...</code> 进行逻辑 <strong>与的运算</strong>(AND)</li>
18-
<li><code>&quot;|(expr1,expr2,...)&quot;</code>,运算过程为对 2 个或以上内部表达式 <code>expr1, expr2, ...</code> 进行逻辑 <strong>或的运算</strong>(OR)</li>
12+
<li><code>'t'</code>,运算结果为 <code>true</code></li>
13+
<li><code>'f'</code>,运算结果为 <code>false</code></li>
14+
<li><code>'!(subExpr)'</code>,运算过程为对内部表达式 <code>subExpr</code> 进行 <strong>逻辑非</strong>(NOT)运算</li>
15+
<li><code>'&amp;(subExpr<sub>1</sub>, subExpr<sub>2</sub>, ..., subExpr<sub>n</sub>)'</code>,运算过程为对 2 个或以上内部表达式 <code>subExpr<sub>1</sub>, subExpr<sub>2</sub>, ..., subExpr<sub>n</sub></code> 进行 <strong>逻辑与</strong>(AND)运算</li>
16+
<li><code>'|(subExpr<sub>1</sub>, subExpr<sub>2</sub>, ..., subExpr<sub>n</sub>)'</code>,运算过程为对 2 个或以上内部表达式 <code>subExpr<sub>1</sub>, subExpr<sub>2</sub>, ..., subExpr<sub>n</sub></code> 进行 <strong>逻辑或</strong>(OR)运算</li>
1917
</ul>
2018

19+
<p>给你一个以字符串形式表述的&nbsp;<a href="https://baike.baidu.com/item/%E5%B8%83%E5%B0%94%E8%A1%A8%E8%BE%BE%E5%BC%8F/1574380?fr=aladdin" target="_blank">布尔表达式</a>(boolean) <code>expression</code>,返回该式的运算结果。</p>
20+
2121
<p>&nbsp;</p>
2222

23-
<p><strong>示例 1:</strong></p>
23+
<p><strong class="example">示例 1:</strong></p>
2424

25-
<pre><strong>输入:</strong>expression = &quot;!(f)&quot;
26-
<strong>输出:</strong>true
25+
<pre>
26+
<strong>输入:</strong>expression = "&amp;(|(f))"
27+
<strong>输出:</strong>false
28+
<strong>解释:</strong>
29+
首先,计算 |(f) --&gt; f ,表达式变为 "&amp;(f)" 。
30+
接着,计算 &amp;(f) --&gt; f ,表达式变为 "f" 。
31+
最后,返回 false 。
2732
</pre>
2833

29-
<p><strong>示例 2:</strong></p>
34+
<p><strong class="example">示例 2:</strong></p>
3035

31-
<pre><strong>输入:</strong>expression = &quot;|(f,t)&quot;
36+
<pre>
37+
<strong>输入:</strong>expression = "|(f,f,f,t)"
3238
<strong>输出:</strong>true
39+
<strong>解释:</strong>计算 (false OR false OR false OR true) ,结果为 true 。
3340
</pre>
3441

35-
<p><strong>示例 3:</strong></p>
42+
<p><strong class="example">示例 3:</strong></p>
3643

37-
<pre><strong>输入:</strong>expression = &quot;&amp;(t,f)&quot;
38-
<strong>输出:</strong>false
39-
</pre>
40-
41-
<p><strong>示例 4:</strong></p>
42-
43-
<pre><strong>输入:</strong>expression = &quot;|(&amp;(t,f,t),!(t))&quot;
44-
<strong>输出:</strong>false
44+
<pre>
45+
<strong>输入:</strong>expression = "!(&amp;(f,t))"
46+
<strong>输出:</strong>true
47+
<strong>解释:</strong>
48+
首先,计算 &amp;(f,t) --&gt; (false AND true) --&gt; false --&gt; f ,表达式变为 "!(f)" 。
49+
接着,计算 !(f) --&gt; NOT false --&gt; true ,返回 true 。
4550
</pre>
4651

4752
<p>&nbsp;</p>
4853

4954
<p><strong>提示:</strong></p>
5055

5156
<ul>
52-
<li><code>1 &lt;= expression.length &lt;= 20000</code></li>
53-
<li><code>expression[i]</code> 由 <code>{&#39;(&#39;, &#39;)&#39;, &#39;&amp;&#39;, &#39;|&#39;, &#39;!&#39;, &#39;t&#39;, &#39;f&#39;, &#39;,&#39;}</code> 中的字符组成。</li>
54-
<li><code>expression</code> 是以上述形式给出的有效表达式,表示一个布尔值。</li>
57+
<li><code>1 &lt;= expression.length &lt;= 2 * 10<sup>4</sup></code></li>
58+
<li><code>expression[i]</code> 为 <code>'('</code>、<code>')'</code>、<code>'&amp;'</code>、<code>'|'</code>、<code>'!'</code>、<code>'t'</code>、<code>'f'</code> 和 <code>','</code> 之一</li>
5559
</ul>
5660

5761
## 解法

solution/1300-1399/1346.Check If N and Its Double Exist/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public:
223223
};
224224
```
225225
226-
227226
### **Go**
228227
229228
```go

solution/1300-1399/1346.Check If N and Its Double Exist/README_EN.md

-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ public:
189189
};
190190
```
191191
192-
193192
### **Go**
194193
195194
```go

solution/1300-1399/1348.Tweet Counts Per Frequency/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ class TweetCounts {
108108
public TweetCounts() {
109109

110110
}
111-
111+
112112
public void recordTweet(String tweetName, int time) {
113113
data.putIfAbsent(tweetName, new TreeMap<>());
114114
var tm = data.get(tweetName);
115115
tm.put(time, tm.getOrDefault(time, 0) + 1);
116116
}
117-
117+
118118
public List<Integer> getTweetCountsPerFrequency(String freq, String tweetName, int startTime, int endTime) {
119119
int f = 60;
120120
if ("hour".equals(freq)) {

solution/1300-1399/1352.Product of the Last K Numbers/README_EN.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class ProductOfNumbers {
8888
public ProductOfNumbers() {
8989
s.add(1);
9090
}
91-
91+
9292
public void add(int num) {
9393
if (num == 0) {
9494
s.clear();
@@ -97,7 +97,7 @@ class ProductOfNumbers {
9797
}
9898
s.add(s.get(s.size() - 1) * num);
9999
}
100-
100+
101101
public int getProduct(int k) {
102102
int n = s.size();
103103
return n <= k ? 0 : s.get(n - 1) / s.get(n - k - 1);
@@ -120,7 +120,7 @@ public:
120120
ProductOfNumbers() {
121121
s.push_back(1);
122122
}
123-
123+
124124
void add(int num) {
125125
if (num == 0) {
126126
s.clear();
@@ -129,7 +129,7 @@ public:
129129
}
130130
s.push_back(s.back() * num);
131131
}
132-
132+
133133
int getProduct(int k) {
134134
int n = s.size();
135135
return n <= k ? 0 : s.back() / s[n - k - 1];

solution/1300-1399/1357.Apply Discount Every n Orders/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Cashier {
109109
d.put(products[j], prices[j]);
110110
}
111111
}
112-
112+
113113
public double getBill(int[] product, int[] amount) {
114114
int dis = (++i) % n == 0 ? discount : 0;
115115
double ans = 0;
@@ -141,7 +141,7 @@ public:
141141
d[products[j]] = prices[j];
142142
}
143143
}
144-
144+
145145
double getBill(vector<int> product, vector<int> amount) {
146146
int dis = (++i) % n == 0 ? discount : 0;
147147
double ans = 0;

solution/1300-1399/1396.Design Underground System/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<ul>
1414
<li><code>void checkIn(int id, string stationName, int t)</code>
15+
1516
<ul>
1617
<li>通行卡 ID 等于 <code>id</code> 的乘客,在时间 <code>t</code> ,从 <code>stationName</code> 站进入</li>
1718
<li>乘客一次只能从一个站进入</li>
@@ -30,6 +31,7 @@
3031
<li>在调用 <code>getAverageTime</code> 之前,至少有一名乘客从 <code>startStation</code> 站到达 <code>endStation</code> 站</li>
3132
</ul>
3233
</li>
34+
3335
</ul>
3436

3537
<p>你可以假设对 <code>checkIn</code> 和 <code>checkOut</code> 方法的所有调用都是符合逻辑的。如果一名乘客在时间 <code>t<sub>1</sub></code> 进站、时间 <code>t<sub>2</sub></code> 出站,那么 <code>t<sub>1</sub> &lt; t<sub>2</sub></code> 。所有时间都按时间顺序发生。</p>

solution/1500-1599/1569.Number of Ways to Reorder Array to Get Same BST/README.md

+12-24
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
# [1569. 将子数组重新排序得到同一个二叉查找树的方案数](https://leetcode.cn/problems/number-of-ways-to-reorder-array-to-get-same-bst)
1+
# [1569. 将子数组重新排序得到同一个二叉搜索树的方案数](https://leetcode.cn/problems/number-of-ways-to-reorder-array-to-get-same-bst)
22

33
[English Version](/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/README_EN.md)
44

55
## 题目描述
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给你一个数组 <code>nums</code>&nbsp;表示 <code>1</code>&nbsp;到 <code>n</code>&nbsp;的一个排列。我们按照元素在 <code>nums</code>&nbsp;中的顺序依次插入一个初始为空的二叉查找树(BST)。请你统计将 <code>nums</code>&nbsp;重新排序后,统计满足如下条件的方案数:重排后得到的二叉查找树与 <code>nums</code>&nbsp;原本数字顺序得到的二叉查找树相同。</p>
9+
<p>给你一个数组 <code>nums</code>&nbsp;表示 <code>1</code>&nbsp;到 <code>n</code>&nbsp;的一个排列。我们按照元素在 <code>nums</code>&nbsp;中的顺序依次插入一个初始为空的二叉搜索树(BST)。请你统计将 <code>nums</code>&nbsp;重新排序后,统计满足如下条件的方案数:重排后得到的二叉搜索树与 <code>nums</code>&nbsp;原本数字顺序得到的二叉搜索树相同。</p>
1010

1111
<p>比方说,给你&nbsp;<code>nums = [2,1,3]</code>,我们得到一棵 2 为根,1 为左孩子,3 为右孩子的树。数组&nbsp;<code>[2,3,1]</code>&nbsp;也能得到相同的 BST,但&nbsp;<code>[3,2,1]</code>&nbsp;会得到一棵不同的&nbsp;BST 。</p>
1212

13-
<p>请你返回重排 <code>nums</code>&nbsp;后,与原数组 <code>nums</code>&nbsp;得到相同二叉查找树的方案数。</p>
13+
<p>请你返回重排 <code>nums</code>&nbsp;后,与原数组 <code>nums</code> 得到相同二叉搜索树的方案数。</p>
1414

1515
<p>由于答案可能会很大,请将结果对<strong>&nbsp;</strong><code>10^9 + 7</code>&nbsp;取余数。</p>
1616

1717
<p>&nbsp;</p>
1818

1919
<p><strong>示例 1:</strong></p>
2020

21-
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/bb.png" style="height: 101px; width: 121px;"></p>
21+
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/bb.png" style="height: 101px; width: 121px;" /></p>
2222

23-
<pre><strong>输入:</strong>nums = [2,1,3]
23+
<pre>
24+
<strong>输入:</strong>nums = [2,1,3]
2425
<strong>输出:</strong>1
2526
<strong>解释:</strong>我们将 nums 重排, [2,3,1] 能得到相同的 BST 。没有其他得到相同 BST 的方案了。
2627
</pre>
2728

2829
<p><strong>示例 2:</strong></p>
2930

30-
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/ex1.png" style="height: 161px; width: 241px;"></strong></p>
31+
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/ex1.png" style="height: 161px; width: 241px;" /></strong></p>
3132

32-
<pre><strong>输入:</strong>nums = [3,4,5,1,2]
33+
<pre>
34+
<strong>输入:</strong>nums = [3,4,5,1,2]
3335
<strong>输出:</strong>5
3436
<strong>解释:</strong>下面 5 个数组会得到相同的 BST:
3537
[3,1,2,4,5]
@@ -41,28 +43,14 @@
4143

4244
<p><strong>示例 3:</strong></p>
4345

44-
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/ex4.png" style="height: 161px; width: 121px;"></strong></p>
46+
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/ex4.png" style="height: 161px; width: 121px;" /></strong></p>
4547

46-
<pre><strong>输入:</strong>nums = [1,2,3]
48+
<pre>
49+
<strong>输入:</strong>nums = [1,2,3]
4750
<strong>输出:</strong>0
4851
<strong>解释:</strong>没有别的排列顺序能得到相同的 BST 。
4952
</pre>
5053

51-
<p><strong>示例 4:</strong></p>
52-
53-
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1569.Number%20of%20Ways%20to%20Reorder%20Array%20to%20Get%20Same%20BST/images/abc.png" style="height: 161px; width: 241px;"></strong></p>
54-
55-
<pre><strong>输入:</strong>nums = [3,1,2,5,4,6]
56-
<strong>输出:</strong>19
57-
</pre>
58-
59-
<p><strong>示例&nbsp; 5:</strong></p>
60-
61-
<pre><strong>输入:</strong>nums = [9,4,2,1,3,6,5,7,8,14,11,10,12,13,16,15,17,18]
62-
<strong>输出:</strong>216212978
63-
<strong>解释:</strong>得到相同 BST 的方案数是 3216212999。将它对 10^9 + 7 取余后得到 216212978。
64-
</pre>
65-
6654
<p>&nbsp;</p>
6755

6856
<p><strong>提示:</strong></p>

solution/2100-2199/2152.Minimum Number of Lines to Cover Points/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656

5757
函数 $dfs(state)$ 的计算过程如下:
5858

59-
- 如果 `state` 的所有位都为 $1$,则说明所有直线都已经添加,返回 $0$。
60-
- 否则,我们枚举当前还未添加的点 $i$,接下来枚举 $j$,我们将 $i$ 和 $j$ 的点连成一条直线,此时的状态为 $nxt = state | 1 << i | 1 << j$,其中 $1 << i$ 表示将第 $i$ 位设置为 $1$,$1 << j$ 表示将第 $j$ 位设置为 $1$。接下来,我们枚举所有 $k$,如果 $i$、$j$ 和 $k$ 三个点共线,则将 $k$ 的状态设置为 $1$,即 $nxt = nxt | 1 << k$。此时,我们可以将 $i$ 和 $j$ 以及 $k$ 这三个点连成一条直线,此时的状态为 $nxt$,此时至少需要添加 $dfs(nxt)$ 条直线,我们取所有情况的最小值,即为 $dfs(state)$ 的值。
59+
- 如果 `state` 的所有位都为 $1$,则说明所有直线都已经添加,返回 $0$。
60+
- 否则,我们枚举当前还未添加的点 $i$,接下来枚举 $j$,我们将 $i$ 和 $j$ 的点连成一条直线,此时的状态为 $nxt = state | 1 << i | 1 << j$,其中 $1 << i$ 表示将第 $i$ 位设置为 $1$,$1 << j$ 表示将第 $j$ 位设置为 $1$。接下来,我们枚举所有 $k$,如果 $i$、$j$ 和 $k$ 三个点共线,则将 $k$ 的状态设置为 $1$,即 $nxt = nxt | 1 << k$。此时,我们可以将 $i$ 和 $j$ 以及 $k$ 这三个点连成一条直线,此时的状态为 $nxt$,此时至少需要添加 $dfs(nxt)$ 条直线,我们取所有情况的最小值,即为 $dfs(state)$ 的值。
6161

6262
为了避免重复计算,我们可以使用记忆化搜索。
6363

solution/2100-2199/2180.Count Integers With Even Digit Sum/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
**方法二:数学**
5353

54-
我们观察发现,在 $[0,..x]$ 的所有数中,每 $10$ 个数中,就有 $5$ 个数的各位数字之和为偶数。例如,$[0,..9]$ 中,每 $10$ 个数中,就有 $5$ 个数的各位数字之和为偶数,分别是 $0,2,4,6,8$。
54+
我们观察发现,在 $[0,..x]$ 的所有数中,每 $10$ 个数中,就有 $5$ 个数的各位数字之和为偶数。例如,$[0,..9]$ 中,每 $10$ 个数中,就有 $5$ 个数的各位数字之和为偶数,分别是 $0,2,4,6,8$。
5555

5656
因此,我们可以先算出 $num$ 中有多少个 $10$ 的倍数,然后乘以 $5$ 再减去 $1$(排除 $0$ 这个偶数),可以得到初始答案 $ans=\left\lfloor \frac{num}{10} \right\rfloor \times 5 - 1$。
5757

solution/2500-2599/2505.Bitwise OR of All Subsequence Sums/README.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
# [2505. Bitwise OR of All Subsequence Sums](https://leetcode.cn/problems/bitwise-or-of-all-subsequence-sums)
1+
# [2505. 所有子序列和的按位或](https://leetcode.cn/problems/bitwise-or-of-all-subsequence-sums)
22

33
[English Version](/solution/2500-2599/2505.Bitwise%20OR%20of%20All%20Subsequence%20Sums/README_EN.md)
44

55
## 题目描述
66

77
<!-- 这里写题目描述 -->
88

9-
<p>Given an integer array <code>nums</code>, return <em>the value of the bitwise </em><strong>OR</strong><em> of the sum of all possible <strong>subsequences</strong> in the array</em>.</p>
9+
<p>给你一个整数数组 <code>nums</code> ,返回对数组中所有可能的 <strong>子序列</strong> 之和进行按位 <strong></strong> 运算后得到的值。</p>
1010

11-
<p>A <strong>subsequence</strong> is a sequence that can be derived from another sequence by removing zero or more elements without changing the order of the remaining elements.</p>
11+
<p>数组的<strong> 子序列 </strong>是从数组中删除零个或多个元素且不改变剩余元素的顺序得到的序列。</p>
1212

1313
<p>&nbsp;</p>
14-
<p><strong class="example">Example 1:</strong></p>
14+
15+
<p><strong>示例&nbsp;1:</strong></p>
1516

1617
<pre>
17-
<strong>Input:</strong> nums = [2,1,0,3]
18-
<strong>Output:</strong> 7
19-
<strong>Explanation:</strong> All possible subsequence sums that we can have are: 0, 1, 2, 3, 4, 5, 6.
20-
And we have 0 OR 1 OR 2 OR 3 OR 4 OR 5 OR 6 = 7, so we return 7.
18+
<b>输入:</b>nums = [2,1,0,3]
19+
<b>输出:</b>7
20+
<strong>解释:</strong>所有可能的子序列的和包括:0、1、2、3、4、5、6 。
21+
由于 0 OR 1 OR 2 OR 3 OR 4 OR 5 OR 6 = 7,所以返回 7 。
2122
</pre>
2223

23-
<p><strong class="example">Example 2:</strong></p>
24+
<p><strong>示例 2:</strong></p>
2425

2526
<pre>
26-
<strong>Input:</strong> nums = [0,0,0]
27-
<strong>Output:</strong> 0
28-
<strong>Explanation:</strong> 0 is the only possible subsequence sum we can have, so we return 0.
27+
<b>输入:</b>nums = [0,0,0]
28+
<b>输出:</b>0
29+
<strong>解释:</strong>0 是唯一可能的子序列的和,所以返回 0 。
2930
</pre>
3031

3132
<p>&nbsp;</p>
32-
<p><strong>Constraints:</strong></p>
33+
34+
<p><strong>提示:</strong></p>
3335

3436
<ul>
3537
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>

solution/2500-2599/2520.Count the Digits That Divide a Number/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int countDigits(int num) {
159159
while (cur) {
160160
if (num % (cur % 10) == 0) {
161161
ans++;
162-
}
162+
}
163163
cur /= 10;
164164
}
165165
return ans;

solution/2500-2599/2520.Count the Digits That Divide a Number/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int countDigits(int num) {
146146
while (cur) {
147147
if (num % (cur % 10) == 0) {
148148
ans++;
149-
}
149+
}
150150
cur /= 10;
151151
}
152152
return ans;

0 commit comments

Comments
 (0)