Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d37504b

Browse files
committed
feat: change images path
1 parent bb71790 commit d37504b

File tree

79 files changed

+952
-627
lines changed

Some content is hidden

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

79 files changed

+952
-627
lines changed

solution/1400-1499/1463.Cherry Pickup II/README.md

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

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

26-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/sample_1_1802.png" style="height: 182px; width: 139px;"></strong></p>
26+
![](./images/sample_1_1802.png)
2727

2828
<pre><strong>输入:</strong>grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]]
2929
<strong>输出:</strong>24
@@ -35,7 +35,7 @@
3535

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

38-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/sample_2_1802.png" style="height: 257px; width: 284px;"></strong></p>
38+
![](./images/sample_2_1802.png)
3939

4040
<pre><strong>输入:</strong>grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]]
4141
<strong>输出:</strong>28

solution/1400-1499/1463.Cherry Pickup II/README_EN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
<p>&nbsp;</p>
2222
<p><strong>Example 1:</strong></p>
2323

24-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/04/29/sample_1_1802.png" style="width: 139px; height: 182px;" /></strong></p>
24+
![](./images/sample_1_1802.png)
25+
2526

2627
<pre>
2728
<strong>Input:</strong> grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]]
@@ -34,7 +35,7 @@ Total of cherries: 12 + 12 = 24.
3435

3536
<p><strong>Example 2:</strong></p>
3637

37-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/04/23/sample_2_1802.png" style="width: 284px; height: 257px;" /></strong></p>
38+
![](./images/sample_2_1802.png)
3839

3940
<pre>
4041
<strong>Input:</strong> grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]]
Loading
Loading

solution/1400-1499/1465.Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts/README.md

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

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

16-
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/leetcode_max_area_2.png" style="height: 320px; width: 300px;"></p>
16+
![](./images/leetcode_max_area_2.png)
1717

1818
<pre><strong>输入:</strong>h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3]
1919
<strong>输出:</strong>4
@@ -22,7 +22,7 @@
2222

2323
<p><strong>示例 2:</strong></p>
2424

25-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/leetcode_max_area_3.png" style="height: 320px; width: 300px;"></strong></p>
25+
![](./images/leetcode_max_area_3.png)
2626

2727
<pre><strong>输入:</strong>h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1]
2828
<strong>输出:</strong>6

solution/1400-1499/1465.Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<p>&nbsp;</p>
1212
<p><strong>Example 1:</strong></p>
1313

14-
<p><img alt="" src="https://assets.leetcode.com/uploads/2020/05/14/leetcode_max_area_2.png" style="width: 300px; height: 320px;" /></p>
14+
![](./images/leetcode_max_area_2.png)
1515

1616
<pre>
1717
<strong>Input:</strong> h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3]
@@ -21,7 +21,7 @@
2121

2222
<p><strong>Example 2:</strong></p>
2323

24-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/05/14/leetcode_max_area_3.png" style="width: 300px; height: 320px;" /></strong></p>
24+
![](./images/leetcode_max_area_3.png)
2525

2626
<pre>
2727
<strong>Input:</strong> h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1]

solution/1400-1499/1466.Reorder Routes to Make All Paths Lead to the City Zero/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919

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

22-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/sample_1_1819.png" style="height: 150px; width: 240px;"></strong></p>
22+
23+
![](./images/sample_1_1819.png)
2324

2425
<pre><strong>输入:</strong>n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]
2526
<strong>输出:</strong>3
2627
<strong>解释:</strong>更改以红色显示的路线的方向,使每个城市都可以到达城市 0 。</pre>
2728

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

30-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/05/30/sample_2_1819.png" style="height: 60px; width: 380px;"></strong></p>
31+
32+
![](./images/sample_2_1819.png)
3133

3234
<pre><strong>输入:</strong>n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]
3335
<strong>输出:</strong>2

solution/1400-1499/1466.Reorder Routes to Make All Paths Lead to the City Zero/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<p>&nbsp;</p>
1818
<p><strong>Example 1:</strong></p>
1919

20-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/05/13/sample_1_1819.png" style="width: 240px; height: 150px;" /></strong></p>
20+
![](./images/sample_1_1819.png)
2121

2222
<pre>
2323
<strong>Input:</strong> n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]
@@ -26,7 +26,7 @@
2626

2727
<p><strong>Example 2:</strong></p>
2828

29-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/05/13/sample_2_1819.png" style="width: 380px; height: 60px;" /></strong></p>
29+
![](./images/sample_2_1819.png)
3030

3131
<pre>
3232
<strong>Input:</strong> n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]

solution/1400-1499/1478.Allocate Mailboxes/README.md

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

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

18-
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/06/13/sample_11_1816.png" style="height: 154px; width: 454px;"></p>
18+
![](./images/sample_11_1816.png)
1919

2020
<pre><strong>输入:</strong>houses = [1,4,8,10,20], k = 3
2121
<strong>输出:</strong>5
@@ -25,7 +25,7 @@
2525

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

28-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/06/13/sample_2_1816.png" style="height: 154px; width: 433px;"></strong></p>
28+
![](./images/sample_2_1816.png)
2929

3030
<pre><strong>输入:</strong>houses = [2,3,5,12,18], k = 2
3131
<strong>输出:</strong>9
Lines changed: 128 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,129 @@
1-
# [1478. Allocate Mailboxes](https://leetcode.com/problems/allocate-mailboxes)
2-
3-
[中文文档](/solution/1400-1499/1478.Allocate%20Mailboxes/README.md)
4-
5-
## Description
6-
7-
<p>Given the array <code>houses</code> and an integer <code>k</code>. where <code>houses[i]</code> is the location of the ith house along a street, your task is to allocate <code>k</code> mailboxes in&nbsp;the street.</p>
8-
9-
<p>Return the <strong>minimum</strong> total distance between each house and its nearest mailbox.</p>
10-
11-
<p>The answer is guaranteed to fit in a 32-bit signed integer.</p>
12-
13-
<p>&nbsp;</p>
14-
<p><strong>Example 1:</strong></p>
15-
16-
<p><img alt="" src="https://assets.leetcode.com/uploads/2020/05/07/sample_11_1816.png" style="width: 454px; height: 154px;" /></p>
17-
18-
<pre>
19-
<strong>Input:</strong> houses = [1,4,8,10,20], k = 3
20-
<strong>Output:</strong> 5
21-
<strong>Explanation: </strong>Allocate mailboxes in position 3, 9 and 20.
22-
Minimum total distance from each houses to nearest mailboxes is |3-1| + |4-3| + |9-8| + |10-9| + |20-20| = 5
23-
</pre>
24-
25-
<p><strong>Example 2:</strong></p>
26-
27-
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/05/07/sample_2_1816.png" style="width: 433px; height: 154px;" /></strong></p>
28-
29-
<pre>
30-
<strong>Input:</strong> houses = [2,3,5,12,18], k = 2
31-
<strong>Output:</strong> 9
32-
<strong>Explanation: </strong>Allocate mailboxes in position 3 and 14.
33-
Minimum total distance from each houses to nearest mailboxes is |2-3| + |3-3| + |5-3| + |12-14| + |18-14| = 9.
34-
</pre>
35-
36-
<p><strong>Example 3:</strong></p>
37-
38-
<pre>
39-
<strong>Input:</strong> houses = [7,4,6,1], k = 1
40-
<strong>Output:</strong> 8
41-
</pre>
42-
43-
<p><strong>Example 4:</strong></p>
44-
45-
<pre>
46-
<strong>Input:</strong> houses = [3,6,14,10], k = 4
47-
<strong>Output:</strong> 0
48-
</pre>
49-
50-
<p>&nbsp;</p>
51-
<p><strong>Constraints:</strong></p>
52-
53-
<ul>
54-
<li><code>n == houses.length</code></li>
55-
<li><code>1 &lt;= n&nbsp;&lt;= 100</code></li>
56-
<li><code>1 &lt;= houses[i] &lt;= 10^4</code></li>
57-
<li><code>1 &lt;= k &lt;= n</code></li>
58-
<li>Array <code>houses</code> contain unique integers.</li>
59-
</ul>
60-
61-
## Solutions
62-
63-
64-
65-
<!-- tabs:start -->
66-
67-
### **Python3**
68-
69-
70-
```python
71-
72-
```
73-
74-
### **Java**
75-
76-
77-
```java
78-
79-
```
80-
81-
### **...**
82-
```
83-
84-
```
85-
1+
# [1478. Allocate Mailboxes](https://leetcode.com/problems/allocate-mailboxes)
2+
3+
[中文文档](/solution/1400-1499/1478.Allocate%20Mailboxes/README.md)
4+
5+
## Description
6+
7+
<p>Given the array <code>houses</code> and an integer <code>k</code>. where <code>houses[i]</code> is the location of the ith house along a street, your task is to allocate <code>k</code> mailboxes in&nbsp;the street.</p>
8+
9+
10+
11+
<p>Return the <strong>minimum</strong> total distance between each house and its nearest mailbox.</p>
12+
13+
14+
15+
<p>The answer is guaranteed to fit in a 32-bit signed integer.</p>
16+
17+
18+
19+
<p>&nbsp;</p>
20+
21+
<p><strong>Example 1:</strong></p>
22+
23+
24+
25+
![](./images/sample_11_1816.png)
26+
27+
<pre>
28+
29+
<strong>Input:</strong> houses = [1,4,8,10,20], k = 3
30+
31+
<strong>Output:</strong> 5
32+
33+
<strong>Explanation: </strong>Allocate mailboxes in position 3, 9 and 20.
34+
35+
Minimum total distance from each houses to nearest mailboxes is |3-1| + |4-3| + |9-8| + |10-9| + |20-20| = 5
36+
37+
</pre>
38+
39+
40+
41+
<p><strong>Example 2:</strong></p>
42+
43+
44+
45+
![](./images/sample_2_1816.png)
46+
47+
48+
<pre>
49+
50+
<strong>Input:</strong> houses = [2,3,5,12,18], k = 2
51+
52+
<strong>Output:</strong> 9
53+
54+
<strong>Explanation: </strong>Allocate mailboxes in position 3 and 14.
55+
56+
Minimum total distance from each houses to nearest mailboxes is |2-3| + |3-3| + |5-3| + |12-14| + |18-14| = 9.
57+
58+
</pre>
59+
60+
61+
62+
<p><strong>Example 3:</strong></p>
63+
64+
65+
66+
<pre>
67+
68+
<strong>Input:</strong> houses = [7,4,6,1], k = 1
69+
70+
<strong>Output:</strong> 8
71+
72+
</pre>
73+
74+
75+
76+
<p><strong>Example 4:</strong></p>
77+
78+
79+
80+
<pre>
81+
82+
<strong>Input:</strong> houses = [3,6,14,10], k = 4
83+
84+
<strong>Output:</strong> 0
85+
86+
</pre>
87+
88+
89+
90+
<p>&nbsp;</p>
91+
92+
<p><strong>Constraints:</strong></p>
93+
94+
95+
96+
<ul>
97+
<li><code>n == houses.length</code></li>
98+
<li><code>1 &lt;= n&nbsp;&lt;= 100</code></li>
99+
<li><code>1 &lt;= houses[i] &lt;= 10^4</code></li>
100+
<li><code>1 &lt;= k &lt;= n</code></li>
101+
<li>Array <code>houses</code> contain unique integers.</li>
102+
</ul>
103+
104+
## Solutions
105+
106+
107+
108+
<!-- tabs:start -->
109+
110+
### **Python3**
111+
112+
113+
```python
114+
115+
```
116+
117+
### **Java**
118+
119+
120+
```java
121+
122+
```
123+
124+
### **...**
125+
```
126+
127+
```
128+
86129
<!-- tabs:end -->
Loading
Loading

solution/1400-1499/1483.Kth Ancestor of a Tree Node/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
<p><strong>示例:</strong></p>
1717

18-
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/06/14/1528_ex1.png" style="height: 262px; width: 396px;"></strong></p>
18+
19+
![](./images/1528_ex1.png)
1920

2021
<pre><strong>输入:</strong>
2122
[&quot;TreeAncestor&quot;,&quot;getKthAncestor&quot;,&quot;getKthAncestor&quot;,&quot;getKthAncestor&quot;]

0 commit comments

Comments
 (0)