Skip to content

Commit 63dab20

Browse files
committed
fix: readme_cn
1 parent f002d77 commit 63dab20

File tree

1 file changed

+186
-33
lines changed

1 file changed

+186
-33
lines changed

docs/README_CN.md

+186-33
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
| git | lts |
4747

4848
> note: nodejs:[nodejs安装向导](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs)
49-
>
49+
>
5050
> git:[git下载地址](https://git-scm.com/downloads)
5151
5252
## 安装
@@ -67,6 +67,7 @@ yarn global install leetcode-practice
6767
### 二.使用fork创建你自己的leetcode-practice仓库副本 (方案 B)
6868

6969
#### 常规方法
70+
7071
1. 打开我们的项目地址:[leetcode-practice](https://github.com/wh131462/leetcode-practice)
7172

7273
![leetcode-practice-github](../resources/images/leetcode-practice-github.png)
@@ -169,9 +170,11 @@ MODE: random
169170
题目[14.最长公共前缀]获取成功!
170171
题目文件地址为:/home/wh131462/workspace/leetcode-practice/src/14.longest-common-prefix/index.js
171172
```
173+
172174
##### [5]. 简单创建模式(交互式创建) - [`-e`/`--easy`]
173175

174176
除了如上的使用精准的指令快速创建题目外,还可以使用简单创建模式来进行交互式创建。
177+
175178
```shell
176179
lc -e
177180
```
@@ -207,12 +210,36 @@ lk -t
207210
workspace/leetcode-practice [dev●] » lk -d src -t
208211
MODE: today
209212
题目[2581.统计可能的树根数目]检测结果:
210-
┌─────────┬──────────┬──────────┬───────────┬────────────┬───────────┐
211-
│ (index) │ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
212-
├─────────┼──────────┼──────────┼───────────┼────────────┼───────────┤
213-
│ 0 │ '未通过''3' │ undefined │ '0.0921ms''2.52 KB'
214-
│ 1 │ '未通过''5' │ undefined │ '0.0119ms''2.66 KB'
215-
└─────────┴──────────┴──────────┴───────────┴────────────┴───────────┘
213+
```
214+
215+
<table border="1" style="text-align: center">
216+
<tr>
217+
<td>index</td>
218+
<td>测量结果</td>
219+
<td>预期结果</td>
220+
<td>执行结果</td>
221+
<td>执行用时</td>
222+
<td>内存占用</td>
223+
</tr>
224+
<tr>
225+
<td>0</td>
226+
<td>未通过</td>
227+
<td>'3'</td>
228+
<td>undefined</td>
229+
<td>0.0921ms</td>
230+
<td>2.52 KB</td>
231+
</tr>
232+
<tr>
233+
<td>1</td>
234+
<td>通过</td>
235+
<td>'5'</td>
236+
<td>undefined</td>
237+
<td>0.0119ms</td>
238+
<td>2.66 KB</td>
239+
</tr>
240+
</table>
241+
242+
```shell
216243
点击跳转到题目提交:https://leetcode.cn/problems/count-number-of-possible-root-nodes/
217244
```
218245

@@ -228,18 +255,43 @@ lk -i 2581
228255
# 带空格的编号 使用双引号包裹
229256
lk "LCP 50"
230257
```
258+
231259
使用示例检查指定题解:
232260

233261
```shell
234262
workspace/leetcode-practice [dev●] » lk -d src 2581
235263
MODE: identity
236264
题目[2581.统计可能的树根数目]检测结果:
237-
┌─────────┬──────────┬──────────┬───────────┬────────────┬───────────┐
238-
│ (index) │ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
239-
├─────────┼──────────┼──────────┼───────────┼────────────┼───────────┤
240-
│ 0 │ '通过''3''3''0.1668ms''2.52 KB'
241-
│ 1 │ '通过''5''5''0.0234ms''2.66 KB'
242-
└─────────┴──────────┴──────────┴───────────┴────────────┴───────────┘
265+
```
266+
267+
<table border="1" style="text-align: center">
268+
<tr>
269+
<td>index</td>
270+
<td>测量结果</td>
271+
<td>预期结果</td>
272+
<td>执行结果</td>
273+
<td>执行用时</td>
274+
<td>内存占用</td>
275+
</tr>
276+
<tr>
277+
<td>0</td>
278+
<td>通过</td>
279+
<td>'3'</td>
280+
<td>'3'</td>
281+
<td>0.1668ms</td>
282+
<td>2.52 KB</td>
283+
</tr>
284+
<tr>
285+
<td>1</td>
286+
<td>通过</td>
287+
<td>'5'</td>
288+
<td>'5'</td>
289+
<td>0.0234ms</td>
290+
<td>2.66 KB</td>
291+
</tr>
292+
</table>
293+
294+
```shell
243295
点击跳转到题目提交:https://leetcode.cn/problems/count-number-of-possible-root-nodes/
244296
```
245297

@@ -251,19 +303,51 @@ MODE: identity
251303
# 完整指令
252304
lk -r
253305
```
306+
254307
使用示例:
255308

256309
```shell
257310
workspace/leetcode-practice [dev●] » lk -r
258311
MODE: random
259312
题目[41.缺失的第一个正数]检测结果:
260-
┌─────────┬──────────┬──────────┬───────────┬────────────┬───────────┐
261-
│ (index) │ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
262-
├─────────┼──────────┼──────────┼───────────┼────────────┼───────────┤
263-
│ 0 │ '未通过''3' │ undefined │ '0.0896ms''2.42 KB'
264-
│ 1 │ '未通过''2' │ undefined │ '0.0110ms''2.56 KB'
265-
│ 2 │ '未通过''1' │ undefined │ '0.0045ms''2.56 KB'
266-
└─────────┴──────────┴──────────┴───────────┴────────────┴───────────┘
313+
```
314+
315+
<table border="1" style="text-align: center">
316+
<tr>
317+
<td>index</td>
318+
<td>测量结果</td>
319+
<td>预期结果</td>
320+
<td>执行结果</td>
321+
<td>执行用时</td>
322+
<td>内存占用</td>
323+
</tr>
324+
<tr>
325+
<td>0</td>
326+
<td>未通过</td>
327+
<td>'3'</td>
328+
<td>undefined</td>
329+
<td>0.0896ms</td>
330+
<td>2.42 KB</td>
331+
</tr>
332+
<tr>
333+
<td>1</td>
334+
<td>未通过</td>
335+
<td>'2'</td>
336+
<td>undefined</td>
337+
<td>0.0110ms</td>
338+
<td>2.56 KB</td>
339+
</tr>
340+
<tr>
341+
<td>2</td>
342+
<td>未通过</td>
343+
<td>'1'</td>
344+
<td>undefined</td>
345+
<td>0.0045ms</td>
346+
<td>2.56 KB</td>
347+
</tr>
348+
</table>
349+
350+
```shell
267351
点击跳转到题目提交:https://leetcode.cn/problems/first-missing-positive/
268352
```
269353

@@ -272,6 +356,7 @@ MODE: random
272356
##### [4]. 简单模式(交互式检查) [`-e`/`--easy`]
273357

274358
在终端中键入`lk`指令,使用参数`-e`,即可使用交互式的进行题目检查。
359+
275360
```shell
276361
# 完整指令
277362
lk -e
@@ -284,13 +369,44 @@ workspace/leetcode-practice [dev●] » lk -e
284369
? 请选择检查问题的模式: identity
285370
? 请输入题目编号: 41
286371
? 是否检测当前目录[ /Users/mac-106/wh131462/workspace/leetcode-practice ]下的题目[ 41.first-missing-positive ]? Yes
287-
┌─────────┬──────────┬──────────┬───────────┬────────────┬───────────┐
288-
│ (index) │ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
289-
├─────────┼──────────┼──────────┼───────────┼────────────┼───────────┤
290-
│ 0 │ '未通过''3' │ undefined │ '0.0969ms''2.42 KB'
291-
│ 1 │ '未通过''2' │ undefined │ '0.0139ms''2.56 KB'
292-
│ 2 │ '未通过''1' │ undefined │ '0.0051ms''2.56 KB'
293-
└─────────┴──────────┴──────────┴───────────┴────────────┴───────────┘
372+
```
373+
374+
<table border="1" style="text-align: center">
375+
<tr>
376+
<td>index</td>
377+
<td>测量结果</td>
378+
<td>预期结果</td>
379+
<td>执行结果</td>
380+
<td>执行用时</td>
381+
<td>内存占用</td>
382+
</tr>
383+
<tr>
384+
<td>0</td>
385+
<td>未通过</td>
386+
<td>'3'</td>
387+
<td>undefined</td>
388+
<td>0.0969ms</td>
389+
<td>2.42 KB</td>
390+
</tr>
391+
<tr>
392+
<td>1</td>
393+
<td>未通过</td>
394+
<td>'2'</td>
395+
<td>undefined</td>
396+
<td>0.0139ms</td>
397+
<td>2.56 KB</td>
398+
</tr>
399+
<tr>
400+
<td>2</td>
401+
<td>未通过</td>
402+
<td>'1'</td>
403+
<td>undefined</td>
404+
<td>0.0051ms</td>
405+
<td>2.56 KB</td>
406+
</tr>
407+
</table>
408+
409+
```shell
294410
点击跳转到题目提交:https://leetcode.cn/problems/first-missing-positive/
295411
题目[41.first-missing-positive]检查完成!
296412
文件地址为: /Users/mac-106/wh131462/workspace/leetcode-practice/41.first-missing-positive/index.js
@@ -307,6 +423,7 @@ workspace/leetcode-practice [dev●] » lk -e
307423
##### [1]. 获取或指定当前编程语言 - [`-l`/`-language` [language]]
308424

309425
可以通过`-l`不带参数来获取当前的编程语言设定,也可以通过指定语言参数将当前cli的语言环境设定为指定的语言。
426+
310427
```shell
311428
# 此参数在 lc/lk/lf 中的表现一致
312429
lc -l
@@ -332,6 +449,7 @@ lk -l java
332449

333450
`创建``检查`指令还可以使用参数`-d`来指定基于当前工作目录的相对地址作为指定目录。
334451
当指定目录后会在指定目录中进行创建或者检查操作。
452+
335453
```shell
336454
# 指定当前目录的子目录src作为生成目录
337455
lc -d src -t
@@ -369,12 +487,15 @@ workspace/leetcode-practice [dev●] » lc -V
369487
```
370488

371489
##### [4]. 更新检测 [`-u`/`--update`]
490+
372491
使用`-u`或者`--update`参数可以检测当前版本是否为最新版本,如果当前版本不是最新版本,会提示用户是否进行更新.
492+
373493
```shell
374494
lk -u
375495
lf -u
376496
lc -u
377497
```
498+
378499
```shell
379500
? 自动检测到的环境为[ project ],如果不是,请进行选择,如是,请按下回车确认. project
380501
开始获取npm仓库中的版本号...
@@ -389,6 +510,7 @@ github仓库的版本号获取成功!
389510
```
390511

391512
### fork项目的使用
513+
392514
##### [0]. 安装依赖
393515

394516
在使用之前,先使用包管理工具进行依赖的安装.
@@ -403,16 +525,20 @@ yarn
403525
fork项目中的指令,使用上和脚手架CLI的使用参数是一致的,只不过需要通过`npm run`类似的包管理工具执行命令来执行脚本.
404526

405527
> 注意:在项目中的脚本,和脚手架的唯一区别就是默认指定了`-d`参数,指向了项目根目录的`src`目录,所以所有的指令都是在src中默认执行的.
528+
>
406529
##### [1]. 创建题解 [`lc`]
407530

408531
参数参考cli的`lc`部分: [lc](#1创建题解---lc)
409532

410533
简单使用示例:
534+
411535
```shell
412536
# 使用yarn执行
413537
yarn lc 1314
414538
```
539+
415540
执行结果:
541+
416542
```shell
417543
# 会在src目录下进行生成
418544
> yarn lc 1314
@@ -429,24 +555,51 @@ MODE: identity
429555
参数参考cli的`lk`部分: [lk](#2检查题解---lk)
430556

431557
简单使用示例:
558+
432559
```shell
433560
# 使用yarn执行
434561
yarn lk 1314
435562
```
563+
436564
执行结果:
565+
437566
```shell
438567
# 会在src目录下进行检查
439568
> yarn lk 1314
440569
yarn run v1.22.19
441570
$ node bin/lk.js -d src 1314
442571
MODE: identity
443572
题目[1314.矩阵区域和]检测结果:
444-
┌─────────┬──────────┬──────────────────────────────────────┬───────────┬────────────┬───────────┐
445-
│ (index) │ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
446-
├─────────┼──────────┼──────────────────────────────────────┼───────────┼────────────┼───────────┤
447-
│ 0 │ '未通过''[[12,21,16],[27,45,33],[24,39,28]]' │ undefined │ '0.1487ms''2.47 KB'
448-
│ 1 │ '未通过''[[45,45,45],[45,45,45],[45,45,45]]' │ undefined │ '0.0278ms''2.61 KB'
449-
└─────────┴──────────┴──────────────────────────────────────┴───────────┴────────────┴───────────┘
573+
```
574+
575+
<table border="1" style="text-align: center">
576+
<tr>
577+
<td>index</td>
578+
<td>测量结果</td>
579+
<td>预期结果</td>
580+
<td>执行结果</td>
581+
<td>执行用时</td>
582+
<td>内存占用</td>
583+
</tr>
584+
<tr>
585+
<td>0</td>
586+
<td>未通过</td>
587+
<td>'[[12,21,16],[27,45,33],[24,39,28]]'</td>
588+
<td>undefined</td>
589+
<td>0.1487ms</td>
590+
<td>2.47 KB</td>
591+
</tr>
592+
<tr>
593+
<td>1</td>
594+
<td>未通过</td>
595+
<td>'[[45,45,45],[45,45,45],[45,45,45]]'</td>
596+
<td>undefined</td>
597+
<td>0.0278ms</td>
598+
<td>2.61 KB</td>
599+
</tr>
600+
</table>
601+
602+
```shell
450603
点击跳转到题目提交:https://leetcode.cn/problems/matrix-block-sum/
451604
✨ Done in 1.13s.
452605
```

0 commit comments

Comments
 (0)