Skip to content

Commit 5e4cbbe

Browse files
committed
generate PDF versison
1 parent 6581657 commit 5e4cbbe

File tree

9 files changed

+40
-6
lines changed

9 files changed

+40
-6
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
支持 Progressive Web Apps 的题解电子书《LeetCode Cookbook》 <a href="https://books.halfrost.com/leetcode/" rel="nofollow">Online Reading</a>
3030
</p>
3131

32+
33+
<p align='center'>
34+
离线版本的电子书《LeetCode Cookbook》 <a href="https://books.halfrost.com/leetcode/cookbook.pdf" rel="nofollow">Download here</a>
35+
</p>
36+
37+
<p align='center'>
38+
<img src="https://img.halfrost.com/Leetcode/Cookbook.png">
39+
</p>
40+
3241
## Data Structures
3342

3443
> 标识了 ✅ 的专题是完成所有题目了的,没有标识的是还没有做完所有题目的

leetcode/0717.1-bit-and-2-bit-Characters/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [717. 1-bit and 2-bit Characters](https://leetcode.com/problems/1-bit-and-2-bit-characters/)
22

33

4-
# 题目:
4+
## 题目:
55

66
We have two special characters. The first character can be represented by one bit `0`. The second character can be represented by two bits (`10` or `11`).
77

leetcode/0933.Number-of-Recent-Calls/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44

5-
### 题目
5+
## 题目
66

77
Write a class `RecentCounter` to count recent requests.
88

website/content/ChapterFour/0717.1-bit-and-2-bit-Characters.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [717. 1-bit and 2-bit Characters](https://leetcode.com/problems/1-bit-and-2-bit-characters/)
22

33

4-
# 题目:
4+
## 题目:
55

66
We have two special characters. The first character can be represented by one bit `0`. The second character can be represented by two bits (`10` or `11`).
77

website/content/ChapterFour/0933.Number-of-Recent-Calls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44

5-
### 题目
5+
## 题目
66

77
Write a class `RecentCounter` to count recent requests.
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import os
2+
from os.path import join
3+
from shutil import move
4+
import glob
5+
6+
content = []
7+
oneFile = 'ChapterTwo_OnePDF.md'
8+
current_working_dir = os.getcwd()
9+
# print(f"current_working_dir: {current_working_dir}")
10+
11+
dir_names = glob.glob("*.md")
12+
dir_names.sort()
13+
# print(dir_names)
14+
print(len(dir_names))
15+
for file_name in dir_names:
16+
# print(file_name)
17+
with open(file_name, "r") as myfile:
18+
content = myfile.read()
19+
with open(oneFile, "a") as myfile:
20+
myfile.write("\n")
21+
myfile.write(content)
22+
myfile.write("\n")
23+
24+
print("Finished")

website/content/ChapterOne/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ LeetCode 统计代码运行时长会有波动的,相同的代码提交 10 次
7171

7272
- 本电子书的左上角有搜索栏,可以迅速帮你找到你想看的章节和题号。
7373
- 本电子书每页都接入了 Gitalk,每一页的最下方都有评论框可以评论,如果没有显示出来,请检查自己的网络。
74-
-
74+
- 关于题解,笔者建议这样使用:先自己读题,思考如何解题。如果 15 分钟还没有思路,那么先看笔者的解题思路,但是不要看代码。有思路以后自己用代码实现一遍。如果完全不会写,那就看笔者提供的代码,找出自己到底哪里不会写,找出问题记下来,这就是自己要弥补的知识漏洞。如果自己实现出来了,提交以后有错误,自己先 debug。AC 以后没有到 100% 也先自己思考如何优化。如果每道题自己都能优化到 100% 了,那么一段时间以后进步会很大。所以总的来说,实在没思路,看解题思路;实在优化不到 100%,看看代码。
7575

7676
## 互动与勘误
7777

website/content/ChapterTwo/Array.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Array
33
type: docs
44
---
55

6-
## Array
6+
# Array
77

88
| Title | Solution | Difficulty | Time | Space |收藏|
99
| ----- | :--------: | :----------: | :----: | :-----: | :-----: |

website/content/_index.md

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ LeetCode 统计代码运行时长会有波动的,相同的代码提交 10 次
7070

7171
- 本电子书的左上角有搜索栏,可以迅速帮你找到你想看的章节和题号。
7272
- 本电子书每页都接入了 Gitalk,每一页的最下方都有评论框可以评论,如果没有显示出来,请检查自己的网络。
73+
- 关于题解,笔者建议这样使用:先自己读题,思考如何解题。如果 15 分钟还没有思路,那么先看笔者的解题思路,但是不要看代码。有思路以后自己用代码实现一遍。如果完全不会写,那就看笔者提供的代码,找出自己到底哪里不会写,找出问题记下来,这就是自己要弥补的知识漏洞。如果自己实现出来了,提交以后有错误,自己先 debug。AC 以后没有到 100% 也先自己思考如何优化。如果每道题自己都能优化到 100% 了,那么一段时间以后进步会很大。所以总的来说,实在没思路,看解题思路;实在优化不到 100%,看看代码。
7374

7475
## 互动与勘误
7576

0 commit comments

Comments
 (0)