Skip to content

Commit 5a338eb

Browse files
committed
LeetCode 付费题目描述 201~400
1 parent 1da59b9 commit 5a338eb

File tree

122 files changed

+3431
-122
lines changed

Some content is hidden

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

122 files changed

+3431
-122
lines changed

solution/0200-0299/0243.Shortest Word Distance/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,22 @@
44

55
## 题目描述
66
<!-- 这里写题目描述 -->
7-
None
7+
<p>给定一个单词列表和两个单词 <em>word1</em> 和 <em>word2</em>,返回列表中这两个单词之间的最短距离。</p>
8+
9+
<p><strong>示例:</strong><br>
10+
假设 words = <code>["practice", "makes", "perfect", "coding", "makes"]</code></p>
11+
12+
<pre><strong>输入:</strong> <em>word1</em> = <code>“coding”</code>, <em>word2</em> = <code>“practice”</code>
13+
<strong>输出:</strong> 3
14+
</pre>
15+
16+
<pre><strong>输入:</strong> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"coding"</code>
17+
<strong>输出:</strong> 1
18+
</pre>
19+
20+
<p><strong>注意:</strong><br>
21+
你可以假设 <em>word1</em> 不等于 <em>word2</em>, 并且 <em>word1</em> 和 <em>word2</em> 都在列表里。</p>
22+
823

924

1025
## 解法

solution/0200-0299/0243.Shortest Word Distance/README_EN.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
[中文文档](/solution/0200-0299/0243.Shortest%20Word%20Distance/README.md)
44

55
## Description
6-
None
6+
<p>Given a list of words and two words <em>word1</em> and <em>word2</em>, return the shortest distance between these two words in the list.</p>
7+
8+
<p><strong>Example:</strong><br />
9+
Assume that words = <code>["practice", "makes", "perfect", "coding", "makes"]</code>.</p>
10+
11+
<pre>
12+
<b>Input:</b> <em>word1</em> = <code>“coding”</code>, <em>word2</em> = <code>“practice”</code>
13+
<b>Output:</b> 3
14+
</pre>
15+
16+
<pre>
17+
<b>Input:</b> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"coding"</code>
18+
<b>Output:</b> 1
19+
</pre>
20+
21+
<p><strong>Note:</strong><br />
22+
You may assume that <em>word1</em> <strong>does not equal to</strong> <em>word2</em>, and <em>word1</em> and <em>word2</em> are both in the list.</p>
23+
724

825

926
## Solutions

solution/0200-0299/0244.Shortest Word Distance II/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44

55
## 题目描述
66
<!-- 这里写题目描述 -->
7-
None
7+
<p>请设计一个类,使该类的构造函数能够接收一个单词列表。然后再实现一个方法,该方法能够分别接收两个单词 <em>word1</em> 和 <em>word2,</em>并返回列表中这两个单词之间的最短距离。您的方法将被以不同的参数调用 <em>多次</em>。</p>
8+
9+
<p><strong>示例:</strong><br>
10+
假设 words = <code>["practice", "makes", "perfect", "coding", "makes"]</code></p>
11+
12+
<pre><strong>输入:</strong> <em>word1</em> = <code>“coding”</code>, <em>word2</em> = <code>“practice”</code>
13+
<strong>输出:</strong> 3
14+
</pre>
15+
16+
<pre><strong>输入:</strong> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"coding"</code>
17+
<strong>输出:</strong> 1</pre>
18+
19+
<p><strong>注意:</strong><br>
20+
你可以假设 <em>word1</em> <strong>不等于</strong> <em>word2</em>, 并且 <em>word1</em> 和 <em>word2</em> 都在列表里。</p>
21+
822

923

1024
## 解法

solution/0200-0299/0244.Shortest Word Distance II/README_EN.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,23 @@
33
[中文文档](/solution/0200-0299/0244.Shortest%20Word%20Distance%20II/README.md)
44

55
## Description
6-
None
6+
<p>Design a class which receives a list of words in the constructor, and implements a method that takes two words <em>word1</em> and <em>word2</em> and return the shortest distance between these two words in the list. Your method will be called <em>repeatedly</em> many times with different parameters. </p>
7+
8+
<p><strong>Example:</strong><br />
9+
Assume that words = <code>["practice", "makes", "perfect", "coding", "makes"]</code>.</p>
10+
11+
<pre>
12+
<b>Input:</b> <em>word1</em> = <code>“coding”</code>, <em>word2</em> = <code>“practice”</code>
13+
<b>Output:</b> 3
14+
</pre>
15+
16+
<pre>
17+
<b>Input:</b> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"coding"</code>
18+
<b>Output:</b> 1</pre>
19+
20+
<p><strong>Note:</strong><br />
21+
You may assume that <em>word1</em> <strong>does not equal to</strong> <em>word2</em>, and <em>word1</em> and <em>word2</em> are both in the list.</p>
22+
723

824

925
## Solutions

solution/0200-0299/0245.Shortest Word Distance III/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44

55
## 题目描述
66
<!-- 这里写题目描述 -->
7-
None
7+
<p>给定一个单词列表和两个单词 <em>word1</em> 和 <em>word2</em>,返回列表中这两个单词之间的最短距离。</p>
8+
9+
<p><em>word1</em> 和 <em>word2</em> 是有可能相同的,并且它们将分别表示为列表中两个独立的单词。</p>
10+
11+
<p><strong>示例:</strong><br>
12+
假设 words = <code>["practice", "makes", "perfect", "coding", "makes"]</code>.</p>
13+
14+
<pre><strong>输入:</strong> <em>word1</em> = <code>“makes”</code>, <em>word2</em> = <code>“coding”</code>
15+
<strong>输出:</strong> 1
16+
</pre>
17+
18+
<pre><strong>输入:</strong> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"makes"</code>
19+
<strong>输出:</strong> 3
20+
</pre>
21+
22+
<p><strong>注意:</strong><br>
23+
你可以假设 <em>word1</em> 和 <em>word2</em> 都在列表里。</p>
24+
825

926

1027
## 解法

solution/0200-0299/0245.Shortest Word Distance III/README_EN.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33
[中文文档](/solution/0200-0299/0245.Shortest%20Word%20Distance%20III/README.md)
44

55
## Description
6-
None
6+
<p>Given a list of words and two words <em>word1</em> and <em>word2</em>, return the shortest distance between these two words in the list.</p>
7+
8+
<p><em>word1</em> and <em>word2</em> may be the same and they represent two individual words in the list.</p>
9+
10+
<p><strong>Example:</strong><br />
11+
Assume that words = <code>["practice", "makes", "perfect", "coding", "makes"]</code>.</p>
12+
13+
<pre>
14+
<b>Input:</b> <em>word1</em> = <code>“makes”</code>, <em>word2</em> = <code>“coding”</code>
15+
<b>Output:</b> 1
16+
</pre>
17+
18+
<pre>
19+
<b>Input:</b> <em>word1</em> = <code>"makes"</code>, <em>word2</em> = <code>"makes"</code>
20+
<b>Output:</b> 3
21+
</pre>
22+
23+
<p><strong>Note:</strong><br />
24+
You may assume <em>word1</em> and <em>word2</em> are both in the list.</p>
25+
726

827

928
## Solutions

solution/0200-0299/0246.Strobogrammatic Number/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,34 @@
44

55
## 题目描述
66
<!-- 这里写题目描述 -->
7-
None
7+
<p>中心对称数是指一个数字在旋转了 180 度之后看起来依旧相同的数字(或者上下颠倒地看)。</p>
8+
9+
<p>请写一个函数来判断该数字是否是中心对称数,其输入将会以一个字符串的形式来表达数字。</p>
10+
11+
<p> </p>
12+
13+
<p><strong>示例 1:</strong></p>
14+
15+
<pre><strong>输入:</strong> num = "69"
16+
<strong>输出:</strong> true
17+
</pre>
18+
19+
<p><strong>示例 2:</strong></p>
20+
21+
<pre><strong>输入:</strong> num = "88"
22+
<strong>输出:</strong> true</pre>
23+
24+
<p><strong>示例 3:</strong></p>
25+
26+
<pre><strong>输入:</strong> num = "962"
27+
<strong>输出:</strong> false</pre>
28+
29+
<p><strong>示例 4:</strong></p>
30+
31+
<pre><strong>输入:</strong>num = "1"
32+
<strong>输出:</strong>true
33+
</pre>
34+
835

936

1037
## 解法

solution/0200-0299/0246.Strobogrammatic Number/README_EN.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
[中文文档](/solution/0200-0299/0246.Strobogrammatic%20Number/README.md)
44

55
## Description
6-
None
6+
<p>A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).</p>
7+
8+
<p>Write a function to determine if a number is strobogrammatic. The number is represented as a string.</p>
9+
10+
<p> </p>
11+
<p><strong>Example 1:</strong></p>
12+
<pre><strong>Input:</strong> num = "69"
13+
<strong>Output:</strong> true
14+
</pre><p><strong>Example 2:</strong></p>
15+
<pre><strong>Input:</strong> num = "88"
16+
<strong>Output:</strong> true
17+
</pre><p><strong>Example 3:</strong></p>
18+
<pre><strong>Input:</strong> num = "962"
19+
<strong>Output:</strong> false
20+
</pre><p><strong>Example 4:</strong></p>
21+
<pre><strong>Input:</strong> num = "1"
22+
<strong>Output:</strong> true
23+
</pre>
724

825

926
## Solutions

solution/0200-0299/0248.Strobogrammatic Number III/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44

55
## 题目描述
66
<!-- 这里写题目描述 -->
7-
None
7+
<p>中心对称数是指一个数字在旋转了 180 度之后看起来依旧相同的数字(或者上下颠倒地看)。</p>
8+
9+
<p>写一个函数来计算范围在 [low, high] 之间中心对称数的个数。</p>
10+
11+
<p><strong>示例:</strong></p>
12+
13+
<pre><strong>输入:</strong> low = "50", high = "100"
14+
<strong>输出:</strong> 3
15+
<strong>解释: </strong>69,88 和 96 是三个在该范围内的中心对称数</pre>
16+
17+
<p><strong>注意:</strong><br>
18+
由于范围可能很大,所以 low 和 high 都用字符串表示。</p>
19+
820

921

1022
## 解法

solution/0200-0299/0248.Strobogrammatic Number III/README_EN.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
[中文文档](/solution/0200-0299/0248.Strobogrammatic%20Number%20III/README.md)
44

55
## Description
6-
None
6+
<p>A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).</p>
7+
8+
<p>Write a function to count the total strobogrammatic numbers that exist in the range of low <= num <= high.</p>
9+
10+
<p><b>Example:</b></p>
11+
12+
<pre>
13+
<b>Input:</b> low = "50", high = "100"
14+
<b>Output:</b> 3
15+
<strong>Explanation: </strong>69, 88, and 96 are three strobogrammatic numbers.</pre>
16+
17+
<p><strong>Note:</strong><br />
18+
Because the range might be a large number, the <em>low</em> and <em>high</em> numbers are represented as string.</p>
19+
720

821

922
## Solutions

0 commit comments

Comments
 (0)