Skip to content

Commit 7a7d3f2

Browse files
yanglbmeactions-user
authored andcommitted
docs: prettify code
1 parent 52d4424 commit 7a7d3f2

File tree

3,656 files changed

+32055
-44820
lines changed

Some content is hidden

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

3,656 files changed

+32055
-44820
lines changed

.docsifytopdfrc.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
2-
contents: [ "summary.md" ],
3-
pathToPublic: "pdf/advanced-java.pdf",
4-
pdfOptions: "<options for puppeteer.pdf()>",
5-
removeTemp: true,
6-
emulateMedia: "screen",
7-
}
2+
contents: ["summary.md"],
3+
pathToPublic: "pdf/advanced-java.pdf",
4+
pdfOptions: "<options for puppeteer.pdf()>",
5+
removeTemp: true,
6+
emulateMedia: "screen",
7+
};

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
## 加入我们
8282

83-
刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」​本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 [@kfstorm](https://github.com/kfstorm) 贡献了本项目的所有 [C# 题解](https://github.com/doocs/leetcode/pull/245)
83+
刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」​ 本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 [@kfstorm](https://github.com/kfstorm) 贡献了本项目的所有 [C# 题解](https://github.com/doocs/leetcode/pull/245)
8484

8585
如果你对本项目感兴趣,并且希望加入我们刷题大军,欢迎随时提交 [PR](https://github.com/doocs/leetcode/pulls)。请参考如下步骤:
8686

@@ -111,10 +111,10 @@
111111

112112
<a href="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890" target="_blank"><img src="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890"></a>
113113

114-
> "*You help the developer community practice for interviews, and there is nothing better we could ask for.*" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
114+
> "_You help the developer community practice for interviews, and there is nothing better we could ask for._" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
115115
116116
## 许可证
117117

118118
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">知识共享 版权归属-相同方式共享 4.0 国际 公共许可证</a>
119119

120-
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
120+
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>

README_EN.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
2828
## Solutions
2929

3030
1. [LeetCode](/solution/README_EN.md)
31-
1. [LCOF: *Coding Interviews, 2nd Edition*](/lcof/README_EN.md)
32-
1. [LCCI: *Cracking the Coding Interview, 6th Edition*](/lcci/README_EN.md)
31+
1. [LCOF: _Coding Interviews, 2nd Edition_](/lcof/README_EN.md)
32+
1. [LCCI: _Cracking the Coding Interview, 6th Edition_](/lcci/README_EN.md)
3333

3434
## Basic Algorithms
3535

@@ -54,7 +54,6 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
5454
1. [Lowest Common Ancestor of a Binary Tree](/solution/0200-0299/0236.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Tree/README_EN.md)
5555
1. [Lowest Common Ancestor of a Binary Search Tree](/solution/0200-0299/0235.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Search%20Tree/README_EN.md)
5656

57-
5857
### Math
5958

6059
1. [Set Mismatch](/solution/0600-0699/0645.Set%20Mismatch/README_EN.md)
@@ -65,7 +64,6 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
6564

6665
### Misc
6766

68-
6967
## Maintainer
7068

7169
[Yang Libin](https://github.com/yanglbme): Creator of [@Doocs](https://github.com/doocs) technical community; member of [@TheAlgorithms](https://github.com/TheAlgorithms) organization.
@@ -89,7 +87,7 @@ You can also contribute to [doocs/leetcode](https://github.com/doocs/leetcode) u
8987

9088
## Contributors
9189

92-
This project exists thanks to all the people who contribute.
90+
This project exists thanks to all the people who contribute.
9391

9492
<a href="https://opencollective.com/doocs-leetcode/contributors.svg?width=890&button=true" target="_blank"><img src="https://opencollective.com/doocs-leetcode/contributors.svg?width=890&button=false" /></a>
9593

@@ -101,11 +99,10 @@ Thank you to all our backers and sponsors!
10199

102100
<a href="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890" target="_blank"><img src="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890"></a>
103101

104-
105-
> "*You help the developer community practice for interviews, and there is nothing better we could ask for.*" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
102+
> "_You help the developer community practice for interviews, and there is nothing better we could ask for._" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
106103
107104
## License
108105

109106
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
110107

111-
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
108+
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>

basic/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
- [冒泡排序](./sorting/BubbleSort/README.md)
66
- [插入排序](./sorting/InsertionSort/README.md)
77
- [归并排序](./sorting/MergeSort/README.md)
8-
- [快速排序](./sorting/QuickSort/README.md)
8+
- [快速排序](./sorting/QuickSort/README.md)

basic/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
- [Bubble Sort](./sorting/BubbleSort/README.md)
66
- [Insertion Sort](./sorting/InsertionSort/README.md)
77
- [Merge Sort](./sorting/MergeSort/README.md)
8-
- [Quick Sort](./sorting/QuickSort/README.md)
8+
- [Quick Sort](./sorting/QuickSort/README.md)

basic/sorting/BubbleSort/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ public class BubbleSort {
5858

5959
因此,时间复杂度是 O(n²),这是一种稳定的排序算法。
6060

61-
> 稳定是指,两个相等的数,在排序过后,相对位置保持不变。
61+
> 稳定是指,两个相等的数,在排序过后,相对位置保持不变。

basic/sorting/MergeSort/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ public class MergeSort {
7070

7171
由于合并 n 个元素需要分配一个大小为 n 的额外数组,所以空间复杂度为 O(n)。
7272

73-
这是一种稳定的排序算法。
73+
这是一种稳定的排序算法。

basic/sorting/QuickSort/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# 快速排序
32

43
快速排序也采用了分治的思想:把原始的数组筛选成较小和较大的两个子数组,然后递归地排序两个子数组。
@@ -68,4 +67,4 @@ public class QuickSort {
6867

6968
但是,如果每次在选择基准值的时候,都不幸地选择了子数组里的最大或最小值。即每次把把数组分成了两个更小长度的数组,其中一个长度为 1,另一个的长度是子数组的长度减 1。这样的算法复杂度变成 O(n²)。
7069

71-
和归并排序不同,快速排序在每次递归的过程中,只需要开辟 O(1) 的存储空间来完成操作来实现对数组的修改;而递归次数为 logn,所以它的整体空间复杂度完全取决于压堆栈的次数。
70+
和归并排序不同,快速排序在每次递归的过程中,只需要开辟 O(1) 的存储空间来完成操作来实现对数组的修改;而递归次数为 logn,所以它的整体空间复杂度完全取决于压堆栈的次数。

basic/summary.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- 基础算法通关
2-
- 常见的排序算法
3-
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
4-
- [插入排序](/basic/sorting/InsertionSort/README.md)
5-
- [归并排序](/basic/sorting/MergeSort/README.md)
6-
- [快速排序](/basic/sorting/QuickSort/README.md)
2+
- 常见的排序算法
3+
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
4+
- [插入排序](/basic/sorting/InsertionSort/README.md)
5+
- [归并排序](/basic/sorting/MergeSort/README.md)
6+
- [快速排序](/basic/sorting/QuickSort/README.md)

lcci/01.01.Is Unique/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[English Version](/lcci/01.01.Is%20Unique/README_EN.md)
44

55
## 题目描述
6+
67
<!-- 这里写题目描述 -->
78
<p>实现一个算法,确定一个字符串 <code>s</code> 的所有字符是否全都不同。</p>
89

@@ -23,15 +24,16 @@
2324
<li><code>0 <= len(s) <= 100 </code></li>
2425
<li>如果你不使用额外的数据结构,会很加分。</li>
2526
</ul>
26-
27+
2728

2829
## 解法
29-
<!-- 这里可写通用的实现逻辑 -->
3030

31+
<!-- 这里可写通用的实现逻辑 -->
3132

3233
<!-- tabs:start -->
3334

3435
### **Python3**
36+
3537
<!-- 这里可写当前语言的特殊实现逻辑 -->
3638

3739
```python
@@ -42,6 +44,7 @@ class Solution:
4244
```
4345

4446
### **Java**
47+
4548
<!-- 这里可写当前语言的特殊实现逻辑 -->
4649

4750
```java
@@ -62,8 +65,9 @@ class Solution {
6265
```
6366

6467
### **...**
68+
6569
```
6670
6771
```
6872

69-
<!-- tabs:end -->
73+
<!-- tabs:end -->

lcci/01.01.Is Unique/README_EN.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[中文文档](/lcci/01.01.Is%20Unique/README.md)
44

55
## Description
6+
67
<p>Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?</p>
78

89
<p><strong>Example 1:</strong></p>
@@ -31,12 +32,8 @@
3132
<li><code>0 &lt;= len(s) &lt;= 100 </code></li>
3233
</ul>
3334

34-
35-
36-
3735
## Solutions
3836

39-
4037
<!-- tabs:start -->
4138

4239
### **Python3**
@@ -68,8 +65,9 @@ class Solution {
6865
```
6966

7067
### **...**
68+
7169
```
7270
7371
```
7472

75-
<!-- tabs:end -->
73+
<!-- tabs:end -->

lcci/01.02.Check Permutation/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[English Version](/lcci/01.02.Check%20Permutation/README_EN.md)
44

55
## 题目描述
6+
67
<!-- 这里写题目描述 -->
78
<p>给定两个字符串 <code>s1</code> 和 <code>s2</code>,请编写一个程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。</p>
89

@@ -25,14 +26,14 @@
2526
<li><code>0 &lt;= len(s2) &lt;= 100 </code></li>
2627
</ul>
2728

28-
2929
## 解法
30-
<!-- 这里可写通用的实现逻辑 -->
3130

31+
<!-- 这里可写通用的实现逻辑 -->
3232

3333
<!-- tabs:start -->
3434

3535
### **Python3**
36+
3637
<!-- 这里可写当前语言的特殊实现逻辑 -->
3738

3839
```python
@@ -42,6 +43,7 @@ class Solution:
4243
```
4344

4445
### **Java**
46+
4547
<!-- 这里可写当前语言的特殊实现逻辑 -->
4648

4749
```java
@@ -60,8 +62,9 @@ class Solution {
6062
```
6163

6264
### **...**
65+
6366
```
6467
6568
```
6669

67-
<!-- tabs:end -->
70+
<!-- tabs:end -->

lcci/01.02.Check Permutation/README_EN.md

+3-15
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
[中文文档](/lcci/01.02.Check%20Permutation/README.md)
44

55
## Description
6-
<p>Given two strings,write a method to decide if one is a permutation of the other.</p>
7-
86

7+
<p>Given two strings,write a method to decide if one is a permutation of the other.</p>
98

109
<p><strong>Example 1:</strong></p>
1110

12-
13-
1411
<pre>
1512

1613
<strong>Input: </strong><code>s1</code> = &quot;abc&quot;, <code>s2</code> = &quot;bca&quot;
@@ -19,12 +16,8 @@
1916

2017
</pre>
2118

22-
23-
2419
<p><strong>Example 2:</strong></p>
2520

26-
27-
2821
<pre>
2922

3023
<strong>Input: </strong><code>s1</code> = &quot;abc&quot;, <code>s2</code> = &quot;bad&quot;
@@ -33,20 +26,14 @@
3326

3427
</pre>
3528

36-
37-
3829
<p><strong>Note:</strong></p>
3930
<ol>
4031
<li><code>0 &lt;= len(s1) &lt;= 100 </code></li>
4132
<li><code>0 &lt;= len(s2) &lt;= 100</code></li>
4233
</ol>
4334

44-
45-
46-
4735
## Solutions
4836

49-
5037
<!-- tabs:start -->
5138

5239
### **Python3**
@@ -75,8 +62,9 @@ class Solution {
7562
```
7663

7764
### **...**
65+
7866
```
7967
8068
```
8169

82-
<!-- tabs:end -->
70+
<!-- tabs:end -->

lcci/01.03.String to URL/README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# [面试题 01.03. URL化](https://leetcode-cn.com/problems/string-to-url-lcci)
1+
# [面试题 01.03. URL 化](https://leetcode-cn.com/problems/string-to-url-lcci)
22

33
[English Version](/lcci/01.03.String%20to%20URL/README_EN.md)
44

55
## 题目描述
6+
67
<!-- 这里写题目描述 -->
78
<p>URL化。编写一种方法,将字符串中的空格全部替换为<code>%20</code>。假定该字符串尾部有足够的空间存放新增字符,并且知道字符串的&ldquo;真实&rdquo;长度。(注:用<code>Java</code>实现的话,请使用字符数组实现,以便直接在数组上操作。)</p>
89

@@ -24,14 +25,14 @@
2425
<li>字符串长度在[0, 500000]范围内。</li>
2526
</ol>
2627

27-
2828
## 解法
29-
<!-- 这里可写通用的实现逻辑 -->
3029

30+
<!-- 这里可写通用的实现逻辑 -->
3131

3232
<!-- tabs:start -->
3333

3434
### **Python3**
35+
3536
<!-- 这里可写当前语言的特殊实现逻辑 -->
3637

3738
```python
@@ -42,6 +43,7 @@ class Solution:
4243
```
4344

4445
### **Java**
46+
4547
<!-- 这里可写当前语言的特殊实现逻辑 -->
4648

4749
```java
@@ -64,8 +66,9 @@ class Solution {
6466
```
6567

6668
### **...**
69+
6770
```
6871
6972
```
7073

71-
<!-- tabs:end -->
74+
<!-- tabs:end -->

0 commit comments

Comments
 (0)