Skip to content

Commit efe90c9

Browse files
committed
feat: add solutions to leetcode problem: No.0356. Line Reflection
* add leetcode solutions: No.0356. Line Reflection * fix images path
1 parent 15afb22 commit efe90c9

File tree

23 files changed

+139
-47
lines changed

23 files changed

+139
-47
lines changed

solution/0200-0299/0277.Find the Celebrity/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

21-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_1_bold.PNG" style="height: 181px; width: 186px;" /></p>
21+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_1_bold.png" style="height: 181px; width: 186px;" /></p>
2222

2323
<pre>
2424
<strong>输入: </strong>graph = [
@@ -32,7 +32,7 @@
3232

3333
<p><strong>示例 2:</strong></p>
3434

35-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_2.PNG" style="height: 192px; width: 193px;" /></p>
35+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_2.png" style="height: 192px; width: 193px;" /></p>
3636

3737
<pre>
3838
<strong>输入: </strong>graph = [

solution/0200-0299/0277.Find the Celebrity/README_EN.md

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

1313
<p>&nbsp;</p>
1414
<p><strong>Example 1:</strong></p>
15-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_1_bold.PNG" style="width: 186px; height: 181px;" />
15+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_1_bold.png" style="width: 186px; height: 181px;" />
1616
<pre>
1717
<strong>Input:</strong> graph = [[1,1,0],[0,1,0],[1,1,1]]
1818
<strong>Output:</strong> 1
1919
<strong>Explanation:</strong> There are three persons labeled with 0, 1 and 2. graph[i][j] = 1 means person i knows person j, otherwise graph[i][j] = 0 means person i does not know person j. The celebrity is the person labeled as 1 because both 0 and 2 know him but 1 does not know anybody.
2020
</pre>
2121

2222
<p><strong>Example 2:</strong></p>
23-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_2.PNG" style="width: 193px; height: 192px;" />
23+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0277.Find%20the%20Celebrity/images/277_example_2.png" style="width: 193px; height: 192px;" />
2424
<pre>
2525
<strong>Input:</strong> graph = [[1,0,1],[1,1,0],[0,1,1]]
2626
<strong>Output:</strong> -1

solution/0200-0299/0285.Inorder Successor in BST/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<p><strong>示例 1:</strong></p>
1616

17-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_1.PNG" style="height: 117px; width: 122px;" /></p>
17+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_1.png" style="height: 117px; width: 122px;" /></p>
1818

1919
<pre>
2020
<strong>输入:</strong>root = [2,1,3], p = 1
@@ -24,7 +24,7 @@
2424

2525
<p><strong>示例 2:</strong></p>
2626

27-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_2.PNG" style="height: 229px; width: 246px;" /></p>
27+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_2.png" style="height: 229px; width: 246px;" /></p>
2828

2929
<pre>
3030
<strong>输入:</strong>root = [5,3,6,2,4,null,null,1], p = 6

solution/0200-0299/0285.Inorder Successor in BST/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
<p>&nbsp;</p>
1212
<p><strong>Example 1:</strong></p>
13-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_1.PNG" style="width: 122px; height: 117px;" />
13+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_1.png" style="width: 122px; height: 117px;" />
1414
<pre>
1515
<strong>Input:</strong> root = [2,1,3], p = 1
1616
<strong>Output:</strong> 2
1717
<strong>Explanation:</strong> 1&#39;s in-order successor node is 2. Note that both p and the return value is of TreeNode type.
1818
</pre>
1919

2020
<p><strong>Example 2:</strong></p>
21-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_2.PNG" style="width: 246px; height: 229px;" />
21+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0285.Inorder%20Successor%20in%20BST/images/285_example_2.png" style="width: 246px; height: 229px;" />
2222
<pre>
2323
<strong>Input:</strong> root = [5,3,6,2,4,null,null,1], p = 6
2424
<strong>Output:</strong> null

solution/0300-0399/0356.Line Reflection/README.md

+37-5
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
<p> </p>
1818

1919
<p><strong>示例 1:</strong></p>
20-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_1.PNG" style="width: 389px; height: 340px;" />
20+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_1.png" style="width: 389px; height: 340px;" />
2121
<pre>
2222
<strong>输入:</strong>points = [[1,1],[-1,1]]
2323
<strong>输出:</strong>true
2424
<strong>解释:</strong>可以找出 x = 0 这条线。
2525
</pre>
2626

2727
<p><strong>示例 2:</strong></p>
28-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_2.PNG" style="width: 300px; height: 294px;" />
28+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_2.png" style="width: 300px; height: 294px;" />
2929
<pre>
3030
<strong>输入:</strong>points = [[1,1],[-1,-1]]
3131
<strong>输出:</strong>false
@@ -41,27 +41,59 @@
4141
<li><code>-10^8 <= points[i][j] <= 10^8</code></li>
4242
</ul>
4343

44-
4544
## 解法
4645

4746
<!-- 这里可写通用的实现逻辑 -->
4847

48+
先找出所有点中的最小、最大的 x 坐标 `minX``maxX`。若存在满足条件的直线,则直线 `x = (minX + maxX) / 2`。(或者说:`s = minX + maxX`)
49+
50+
遍历每个点 `point(x, y)`,若 (s - x, y) 不在点集里,说明不满足条件,直接返回 false。遍历结束返回 true。
51+
4952
<!-- tabs:start -->
5053

5154
### **Python3**
5255

5356
<!-- 这里可写当前语言的特殊实现逻辑 -->
5457

5558
```python
56-
59+
class Solution:
60+
def isReflected(self, points: List[List[int]]) -> bool:
61+
min_x, max_x = float('inf'), float('-inf')
62+
point_set = set()
63+
for point in points:
64+
min_x = min(min_x, point[0])
65+
max_x = max(max_x, point[0])
66+
point_set.add((point[0], point[1]))
67+
s = min_x + max_x
68+
for point in points:
69+
if (s - point[0], point[1]) not in point_set:
70+
return False
71+
return True
5772
```
5873

5974
### **Java**
6075

6176
<!-- 这里可写当前语言的特殊实现逻辑 -->
6277

6378
```java
64-
79+
class Solution {
80+
public boolean isReflected(int[][] points) {
81+
int minX = Integer.MAX_VALUE, maxX = Integer.MIN_VALUE;
82+
Set<String> pointSet = new HashSet<>();
83+
for (int[] point : points) {
84+
minX = Math.min(minX, point[0]);
85+
maxX = Math.max(maxX, point[0]);
86+
pointSet.add(point[0] + "." + point[1]);
87+
}
88+
long s = minX + maxX;
89+
for (int[] point : points) {
90+
if (!pointSet.contains((s - point[0]) + "." + point[1])) {
91+
return false;
92+
}
93+
}
94+
return true;
95+
}
96+
}
6597
```
6698

6799
### **...**

solution/0300-0399/0356.Line Reflection/README_EN.md

+33-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Could you do better than O(<i>n</i><sup>2</sup>) ?</p>
1313

1414
<p>&nbsp;</p>
1515
<p><strong>Example 1:</strong></p>
16-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_1.PNG" style="width: 389px; height: 340px;" />
16+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_1.png" style="width: 389px; height: 340px;" />
1717
<pre>
1818
<strong>Input:</strong> points = [[1,1],[-1,1]]
1919
<strong>Output:</strong> true
2020
<strong>Explanation:</strong> We can choose the line x = 0.
2121
</pre>
2222

2323
<p><strong>Example 2:</strong></p>
24-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_2.PNG" style="width: 300px; height: 294px;" />
24+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0356.Line%20Reflection/images/356_example_2.png" style="width: 300px; height: 294px;" />
2525
<pre>
2626
<strong>Input:</strong> points = [[1,1],[-1,-1]]
2727
<strong>Output:</strong> false
@@ -45,13 +45,42 @@ Could you do better than O(<i>n</i><sup>2</sup>) ?</p>
4545
### **Python3**
4646

4747
```python
48-
48+
class Solution:
49+
def isReflected(self, points: List[List[int]]) -> bool:
50+
min_x, max_x = float('inf'), float('-inf')
51+
point_set = set()
52+
for point in points:
53+
min_x = min(min_x, point[0])
54+
max_x = max(max_x, point[0])
55+
point_set.add((point[0], point[1]))
56+
s = min_x + max_x
57+
for point in points:
58+
if (s - point[0], point[1]) not in point_set:
59+
return False
60+
return True
4961
```
5062

5163
### **Java**
5264

5365
```java
54-
66+
class Solution {
67+
public boolean isReflected(int[][] points) {
68+
int minX = Integer.MAX_VALUE, maxX = Integer.MIN_VALUE;
69+
Set<String> pointSet = new HashSet<>();
70+
for (int[] point : points) {
71+
minX = Math.min(minX, point[0]);
72+
maxX = Math.max(maxX, point[0]);
73+
pointSet.add(point[0] + "." + point[1]);
74+
}
75+
long s = minX + maxX;
76+
for (int[] point : points) {
77+
if (!pointSet.contains((s - point[0]) + "." + point[1])) {
78+
return false;
79+
}
80+
}
81+
return true;
82+
}
83+
}
5584
```
5685

5786
### **...**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Solution {
2+
public boolean isReflected(int[][] points) {
3+
int minX = Integer.MAX_VALUE, maxX = Integer.MIN_VALUE;
4+
Set<String> pointSet = new HashSet<>();
5+
for (int[] point : points) {
6+
minX = Math.min(minX, point[0]);
7+
maxX = Math.max(maxX, point[0]);
8+
pointSet.add(point[0] + "." + point[1]);
9+
}
10+
long s = minX + maxX;
11+
for (int[] point : points) {
12+
if (!pointSet.contains((s - point[0]) + "." + point[1])) {
13+
return false;
14+
}
15+
}
16+
return true;
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def isReflected(self, points: List[List[int]]) -> bool:
3+
min_x, max_x = float('inf'), float('-inf')
4+
point_set = set()
5+
for point in points:
6+
min_x = min(min_x, point[0])
7+
max_x = max(max_x, point[0])
8+
point_set.add((point[0], point[1]))
9+
s = min_x + max_x
10+
for point in points:
11+
if (s - point[0], point[1]) not in point_set:
12+
return False
13+
return True

solution/0500-0599/0510.Inorder Successor in BST II/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Node {
2424

2525
<p><strong>示例 1:</strong></p>
2626

27-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_1.PNG" style="height: 117px; width: 122px;" /></p>
27+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_1.png" style="height: 117px; width: 122px;" /></p>
2828

2929
<pre>
3030
<strong>输入:</strong>tree = [2,1,3], node = 1
@@ -34,7 +34,7 @@ class Node {
3434

3535
<p><strong>示例 2:</strong></p>
3636

37-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_2.PNG" style="height: 229px; width: 246px;" /></p>
37+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_2.png" style="height: 229px; width: 246px;" /></p>
3838

3939
<pre>
4040
<strong>输入:</strong>tree = [5,3,6,2,4,null,null,1], node = 6
@@ -44,7 +44,7 @@ class Node {
4444

4545
<p><strong>示例 3:</strong></p>
4646

47-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.PNG" style="height: 335px; width: 438px;" /></p>
47+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.png" style="height: 335px; width: 438px;" /></p>
4848

4949
<pre>
5050
<strong>输入:</strong>tree = [15,6,18,3,7,17,20,2,4,null,13,null,null,null,null,null,null,null,null,9], node = 15
@@ -53,7 +53,7 @@ class Node {
5353

5454
<p><strong>示例 4:</strong></p>
5555

56-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.PNG" style="height: 335px; width: 438px;" /></p>
56+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.png" style="height: 335px; width: 438px;" /></p>
5757

5858
<pre>
5959
<strong>输入:</strong>tree = [15,6,18,3,7,17,20,2,4,null,13,null,null,null,null,null,null,null,null,9], node = 13

solution/0500-0599/0510.Inorder Successor in BST II/README_EN.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ class Node {
2121

2222
<p>&nbsp;</p>
2323
<p><strong>Example 1:</strong></p>
24-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_1.PNG" style="width: 122px; height: 117px;" />
24+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_1.png" style="width: 122px; height: 117px;" />
2525
<pre>
2626
<strong>Input:</strong> tree = [2,1,3], node = 1
2727
<strong>Output:</strong> 2
2828
<strong>Explanation:</strong> 1&#39;s in-order successor node is 2. Note that both the node and the return value is of Node type.
2929
</pre>
3030

3131
<p><strong>Example 2:</strong></p>
32-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_2.PNG" style="width: 246px; height: 229px;" />
32+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_2.png" style="width: 246px; height: 229px;" />
3333
<pre>
3434
<strong>Input:</strong> tree = [5,3,6,2,4,null,null,1], node = 6
3535
<strong>Output:</strong> null
3636
<strong>Explanation:</strong> There is no in-order successor of the current node, so the answer is null.
3737
</pre>
3838

3939
<p><strong>Example 3:</strong></p>
40-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.PNG" style="width: 438px; height: 335px;" />
40+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.png" style="width: 438px; height: 335px;" />
4141
<pre>
4242
<strong>Input:</strong> tree = [15,6,18,3,7,17,20,2,4,null,13,null,null,null,null,null,null,null,null,9], node = 15
4343
<strong>Output:</strong> 17
4444
</pre>
4545

4646
<p><strong>Example 4:</strong></p>
47-
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.PNG" style="width: 438px; height: 335px;" />
47+
<img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0510.Inorder%20Successor%20in%20BST%20II/images/285_example_34.png" style="width: 438px; height: 335px;" />
4848
<pre>
4949
<strong>Input:</strong> tree = [15,6,18,3,7,17,20,2,4,null,13,null,null,null,null,null,null,null,null,9], node = 13
5050
<strong>Output:</strong> 15

solution/0900-0999/0999.Available Captures for Rook/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<p><strong>示例 1:</strong></p>
2525

26-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_1_improved.PNG" style="height: 305px; width: 300px;"></p>
26+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_1_improved.png" style="height: 305px; width: 300px;"></p>
2727

2828
<pre><strong>输入:</strong>[[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
2929
<strong>输出:</strong>3
@@ -33,7 +33,7 @@
3333

3434
<p><strong>示例 2:</strong></p>
3535

36-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_2_improved.PNG" style="height: 306px; width: 300px;"></p>
36+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_2_improved.png" style="height: 306px; width: 300px;"></p>
3737

3838
<pre><strong>输入:</strong>[[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;R&quot;,&quot;B&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;B&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
3939
<strong>输出:</strong>0
@@ -43,7 +43,7 @@
4343

4444
<p><strong>示例 3:</strong></p>
4545

46-
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_3_improved.PNG" style="height: 305px; width: 300px;"></p>
46+
<p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0999.Available%20Captures%20for%20Rook/images/1253_example_3_improved.png" style="height: 305px; width: 300px;"></p>
4747

4848
<pre><strong>输入:</strong>[[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;p&quot;,&quot;p&quot;,&quot;.&quot;,&quot;R&quot;,&quot;.&quot;,&quot;p&quot;,&quot;B&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;B&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;p&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;],[&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;,&quot;.&quot;]]
4949
<strong>输出:</strong>3

0 commit comments

Comments
 (0)