Skip to content

Commit fa5aee7

Browse files
committed
feat: update summary.md
1 parent 89d4cd8 commit fa5aee7

File tree

360 files changed

+25485
-296
lines changed

Some content is hidden

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

360 files changed

+25485
-296
lines changed

solution/0200-0299/0211.Add and Search Word - Data structure design/README.md

-57
This file was deleted.

solution/0200-0299/0211.Add and Search Word - Data structure design/README_EN.md

-77
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# [211. 添加与搜索单词 - 数据结构设计](https://leetcode-cn.com/problems/design-add-and-search-words-data-structure)
2+
3+
[English Version](/solution/0200-0299/0211.Design%20Add%20and%20Search%20Words%20Data%20Structure/README_EN.md)
4+
5+
## 题目描述
6+
7+
<!-- 这里写题目描述 -->
8+
<p>如果数据结构中有任何与word匹配的字符串,则bool search(word)返回true,否则返回false。 单词可能包含点&ldquo;&rdquo; 点可以与任何字母匹配的地方。</p>
9+
10+
<p>请你设计一个数据结构,支持 添加新单词 和 查找字符串是否与任何先前添加的字符串匹配 。</p>
11+
12+
<p>实现词典类 <code>WordDictionary</code> :</p>
13+
14+
<ul>
15+
<li><code>WordDictionary()</code> 初始化词典对象</li>
16+
<li><code>void addWord(word)</code> 将 <code>word</code> 添加到数据结构中,之后可以对它进行匹配</li>
17+
<li><code>bool search(word)</code> 如果数据结构中存在字符串与&nbsp;<code>word</code> 匹配,则返回 <code>true</code> ;否则,返回&nbsp; <code>false</code> 。<code>word</code> 中可能包含一些 <code>&#39;.&#39;</code> ,每个&nbsp;<code>.</code> 都可以表示任何一个字母。</li>
18+
</ul>
19+
20+
<p>&nbsp;</p>
21+
22+
<p><strong>示例:</strong></p>
23+
24+
<pre><strong>输入:</strong>
25+
[&quot;WordDictionary&quot;,&quot;addWord&quot;,&quot;addWord&quot;,&quot;addWord&quot;,&quot;search&quot;,&quot;search&quot;,&quot;search&quot;,&quot;search&quot;]
26+
[[],[&quot;bad&quot;],[&quot;dad&quot;],[&quot;mad&quot;],[&quot;pad&quot;],[&quot;bad&quot;],[&quot;.ad&quot;],[&quot;b..&quot;]]
27+
<strong>输出:</strong>
28+
[null,null,null,null,false,true,true,true]
29+
30+
<strong>解释:</strong>
31+
WordDictionary wordDictionary = new WordDictionary();
32+
wordDictionary.addWord(&quot;bad&quot;);
33+
wordDictionary.addWord(&quot;dad&quot;);
34+
wordDictionary.addWord(&quot;mad&quot;);
35+
wordDictionary.search(&quot;pad&quot;); // return False
36+
wordDictionary.search(&quot;bad&quot;); // return True
37+
wordDictionary.search(&quot;.ad&quot;); // return True
38+
wordDictionary.search(&quot;b..&quot;); // return True
39+
</pre>
40+
41+
<p>&nbsp;</p>
42+
43+
<p><strong>提示:</strong></p>
44+
45+
<ul>
46+
<li><code>1 &lt;= word.length &lt;= 500</code></li>
47+
<li><code>addWord</code> 中的 <code>word</code> 由小写英文字母组成</li>
48+
<li><code>search</code> 中的 <code>word</code> 由 &#39;.&#39; 或小写英文字母组成</li>
49+
<li>最调用多 <code>50000</code> 次 <code>addWord</code> 和 <code>search</code></li>
50+
</ul>
51+
52+
53+
## 解法
54+
55+
<!-- 这里可写通用的实现逻辑 -->
56+
57+
58+
<!-- tabs:start -->
59+
60+
### **Python3**
61+
62+
<!-- 这里可写当前语言的特殊实现逻辑 -->
63+
64+
```python
65+
66+
```
67+
68+
### **Java**
69+
70+
<!-- 这里可写当前语言的特殊实现逻辑 -->
71+
72+
```java
73+
74+
```
75+
76+
### **...**
77+
```
78+
79+
```
80+
81+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# [211. Design Add and Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure)
2+
3+
[中文文档](/solution/0200-0299/0211.Design%20Add%20and%20Search%20Words%20Data%20Structure/README.md)
4+
5+
## Description
6+
7+
<p>You should design a data structure that supports adding new words and finding if a string matches any previously added string.</p>
8+
9+
<p>Implement the <code>WordDictionary</code> class:</p>
10+
11+
<ul>
12+
<li><code>WordDictionary()</code>&nbsp;Initializes the object.</li>
13+
<li><code>void addWord(word)</code> adds <code>word</code> to the data structure, it can be matched later.</li>
14+
<li><code>bool search(word)</code>&nbsp;returns <code>true</code> if there is any string in the data structure that matches <code>word</code>&nbsp;or <code>false</code> otherwise. <code>word</code> may contain dots <code>&#39;.&#39;</code> where dots can be matched with any letter.</li>
15+
</ul>
16+
17+
<p>&nbsp;</p>
18+
<p><strong>Example:</strong></p>
19+
20+
<pre>
21+
<strong>Input</strong>
22+
[&quot;WordDictionary&quot;,&quot;addWord&quot;,&quot;addWord&quot;,&quot;addWord&quot;,&quot;search&quot;,&quot;search&quot;,&quot;search&quot;,&quot;search&quot;]
23+
[[],[&quot;bad&quot;],[&quot;dad&quot;],[&quot;mad&quot;],[&quot;pad&quot;],[&quot;bad&quot;],[&quot;.ad&quot;],[&quot;b..&quot;]]
24+
<strong>Output</strong>
25+
[null,null,null,null,false,true,true,true]
26+
27+
<strong>Explanation</strong>
28+
WordDictionary wordDictionary = new WordDictionary();
29+
wordDictionary.addWord(&quot;bad&quot;);
30+
wordDictionary.addWord(&quot;dad&quot;);
31+
wordDictionary.addWord(&quot;mad&quot;);
32+
wordDictionary.search(&quot;pad&quot;); // return False
33+
wordDictionary.search(&quot;bad&quot;); // return True
34+
wordDictionary.search(&quot;.ad&quot;); // return True
35+
wordDictionary.search(&quot;b..&quot;); // return True
36+
</pre>
37+
38+
<p>&nbsp;</p>
39+
<p><strong>Constraints:</strong></p>
40+
41+
<ul>
42+
<li><code>1 &lt;= word.length &lt;= 500</code></li>
43+
<li><code>word</code> in <code>addWord</code> consists lower-case English letters.</li>
44+
<li><code>word</code> in <code>search</code> consist of&nbsp; &#39;.&#39; or lower-case English letters.</li>
45+
<li>At most <code>50000</code>&nbsp;calls will be made to <code>addWord</code>&nbsp;and <code>search</code> .</li>
46+
</ul>
47+
48+
49+
## Solutions
50+
51+
52+
53+
<!-- tabs:start -->
54+
55+
### **Python3**
56+
57+
58+
```python
59+
60+
```
61+
62+
### **Java**
63+
64+
65+
```java
66+
67+
```
68+
69+
### **...**
70+
```
71+
72+
```
73+
74+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# [597. 好友申请 I :总体通过率](https://leetcode-cn.com/problems/friend-requests-i-overall-acceptance-rate)
2+
3+
[English Version](/solution/0500-0599/0597.Friend%20Requests%20I%3A%20Overall%20Acceptance%20Rate/README_EN.md)
4+
5+
## 题目描述
6+
7+
<!-- 这里写题目描述 -->
8+
None
9+
10+
## 解法
11+
12+
<!-- 这里可写通用的实现逻辑 -->
13+
14+
15+
<!-- tabs:start -->
16+
17+
### **Python3**
18+
19+
<!-- 这里可写当前语言的特殊实现逻辑 -->
20+
21+
```python
22+
23+
```
24+
25+
### **Java**
26+
27+
<!-- 这里可写当前语言的特殊实现逻辑 -->
28+
29+
```java
30+
31+
```
32+
33+
### **...**
34+
```
35+
36+
```
37+
38+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# [597. Friend Requests I: Overall Acceptance Rate](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate)
2+
3+
[中文文档](/solution/0500-0599/0597.Friend%20Requests%20I%3A%20Overall%20Acceptance%20Rate/README.md)
4+
5+
## Description
6+
7+
None
8+
9+
## Solutions
10+
11+
12+
13+
<!-- tabs:start -->
14+
15+
### **Python3**
16+
17+
18+
```python
19+
20+
```
21+
22+
### **Java**
23+
24+
25+
```java
26+
27+
```
28+
29+
### **...**
30+
```
31+
32+
```
33+
34+
<!-- tabs:end -->

0 commit comments

Comments
 (0)