Skip to content

Commit cc937dc

Browse files
authored
refactor: update problem template (doocs#2824)
1 parent 8640250 commit cc937dc

File tree

6,808 files changed

+79707
-10374
lines changed

Some content is hidden

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

6,808 files changed

+79707
-10374
lines changed

basic/sorting/BubbleSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,3 @@ public class Program
217217
```
218218

219219
<!-- tabs:end -->
220-
221-
<!-- end -->

basic/sorting/HeapSort/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ func main() {
286286
}
287287
```
288288

289-
<!-- tabs:end -->## 解法
289+
<!-- tabs:end -->
290+
291+
## 解法
290292

291293
### 方法一
292294

@@ -500,5 +502,3 @@ fn main() -> io::Result<()> {
500502
```
501503

502504
<!-- tabs:end -->
503-
504-
<!-- end -->

basic/sorting/InsertionSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,3 @@ public class Program
197197
```
198198

199199
<!-- tabs:end -->
200-
201-
<!-- end -->

basic/sorting/MergeSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,5 +362,3 @@ process.stdin.on('end', function () {
362362
```
363363

364364
<!-- tabs:end -->
365-
366-
<!-- end -->

basic/sorting/QuickSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,3 @@ process.stdin.on('end', function () {
319319
```
320320

321321
<!-- tabs:end -->
322-
323-
<!-- end -->

basic/sorting/SelectionSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,3 @@ public class Program
199199
```
200200

201201
<!-- tabs:end -->
202-
203-
<!-- end -->

basic/sorting/ShellSort/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,3 @@ console.log(shellSort(arr));
114114
```
115115

116116
<!-- tabs:end -->
117-
118-
<!-- end -->

lcci/01.01.Is Unique/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ difficulty: 简单
44
edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.01.Is%20Unique/README.md
55
---
66

7+
<!-- problem:start -->
8+
79
# [面试题 01.01. 判定字符是否唯一](https://leetcode.cn/problems/is-unique-lcci)
810

911
[English Version](/lcci/01.01.Is%20Unique/README_EN.md)
1012

1113
## 题目描述
1214

13-
<!-- 这里写题目描述 -->
15+
<!-- description:start -->
16+
1417
<p>实现一个算法,确定一个字符串 <code>s</code> 的所有字符是否全都不同。</p>
1518

1619
<p><strong>示例 1:</strong></p>
@@ -31,8 +34,12 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.01.Is%20Unique/REA
3134
<li>如果你不使用额外的数据结构,会很加分。</li>
3235
</ul>
3336

37+
<!-- description:end -->
38+
3439
## 解法
3540

41+
<!-- solution:start -->
42+
3643
### 方法一:位运算
3744

3845
根据示例,可以假定字符串中只包含小写字母(实际验证,也符合假设)。
@@ -152,4 +159,6 @@ class Solution {
152159

153160
<!-- tabs:end -->
154161

155-
<!-- end -->
162+
<!-- solution:end -->
163+
164+
<!-- problem:end -->

lcci/01.01.Is Unique/README_EN.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ difficulty: Easy
44
edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.01.Is%20Unique/README_EN.md
55
---
66

7+
<!-- problem:start -->
8+
79
# [01.01. Is Unique](https://leetcode.cn/problems/is-unique-lcci)
810

911
[中文文档](/lcci/01.01.Is%20Unique/README.md)
1012

1113
## Description
1214

15+
<!-- description:start -->
16+
1317
<p>Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?</p>
1418

1519
<p><strong>Example 1:</strong></p>
@@ -38,8 +42,12 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.01.Is%20Unique/REA
3842
<li><code>0 &lt;= len(s) &lt;= 100 </code></li>
3943
</ul>
4044

45+
<!-- description:end -->
46+
4147
## Solutions
4248

49+
<!-- solution:start -->
50+
4351
### Solution 1: Bit Manipulation
4452

4553
Based on the examples, we can assume that the string only contains lowercase letters (which is confirmed by actual verification).
@@ -159,4 +167,6 @@ class Solution {
159167

160168
<!-- tabs:end -->
161169

162-
<!-- end -->
170+
<!-- solution:end -->
171+
172+
<!-- problem:end -->

lcci/01.02.Check Permutation/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ difficulty: 简单
44
edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.02.Check%20Permutation/README.md
55
---
66

7+
<!-- problem:start -->
8+
79
# [面试题 01.02. 判定是否互为字符重排](https://leetcode.cn/problems/check-permutation-lcci)
810

911
[English Version](/lcci/01.02.Check%20Permutation/README_EN.md)
1012

1113
## 题目描述
1214

13-
<!-- 这里写题目描述 -->
15+
<!-- description:start -->
16+
1417
<p>给定两个字符串 <code>s1</code> 和 <code>s2</code>,请编写一个程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。</p>
1518

1619
<p><strong>示例 1:</strong></p>
@@ -32,8 +35,12 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.02.Check%20Permuta
3235
<li><code>0 &lt;= len(s2) &lt;= 100 </code></li>
3336
</ul>
3437

38+
<!-- description:end -->
39+
3540
## 解法
3641

42+
<!-- solution:start -->
43+
3744
### 方法一:数组或哈希表
3845

3946
我们先判断两个字符串的长度是否相等,若不相等则直接返回 `false`
@@ -205,6 +212,10 @@ class Solution {
205212

206213
<!-- tabs:end -->
207214

215+
<!-- solution:end -->
216+
217+
<!-- solution:start-->
218+
208219
### 方法二:排序
209220

210221
我们也按照字典序对两个字符串进行排序,然后比较两个字符串是否相等。
@@ -271,4 +282,6 @@ impl Solution {
271282

272283
<!-- tabs:end -->
273284

274-
<!-- end -->
285+
<!-- solution:end -->
286+
287+
<!-- problem:end -->

0 commit comments

Comments
 (0)