@@ -11,13 +11,15 @@ Great thanks to leetcode.com, an really awesome website!
1111## Table of Contents
1212
1313* [ Install] ( #install )
14- * [ Quick Start] ( #quick-start )
15- * [1. Login](#1-login)
16- * [2. List](#2-list)
17- * [3. Prepare](#3-prepare)
18- * [4. Coding](#4-coding)
19- * [5. Test](#5-test)
20- * [6. Submit](#6-submit)
14+ * [ Best Practics] ( #best-practice )
15+ * [ Commands] ( #commands )
16+ * [help](#help)
17+ * [list](#list)
18+ * [show](#show)
19+ * [submit](#submit)
20+ * [test](#test)
21+ * [user](#user)
22+ * [version](#version)
2123* [ Tips] ( #tips )
2224 * [Bash Completion](#bash-completion)
2325 * [Colorful Output](#colorful-output)
@@ -27,22 +29,31 @@ Great thanks to leetcode.com, an really awesome website!
2729
2830 $ sudo npm install -g leetcode-cli
2931
30- ## Quick Start
32+ ## Best Practice
3133
32- ### 1. Login
34+ Read help first $ lc help
35+ Login with your leetcoe account $ lc user -l
36+ Browse all problems $ lc list
37+ Select one problem $ lc show 1 -g -l cpp
38+ Coding it!
39+ Run test(s) and pray $ lc test ./two-sum.cpp -t '[3,2,4]\n7'
40+ Submit final solution! $ lc submit ./two-sum.cpp
3341
34- Login with your leetcode account (username or email).
42+ ## Commands
3543
36- $ lc user -l
37- login: <account>
38- pass:
39- Successfully login as <account>
44+ ### help
4045
41- * ` -l ` to login
42- * ` -L ` to logout.
43- * ` lc user ` to show current account.
46+ list [keyword] list problems
47+ show <keyword> show problem by name or index
48+ submit <filename> submit final solution to leetcode
49+ test <filename> send solution to leetcode and run test
50+ user login/logout with leetcode account
51+ version show version info
4452
45- ### 2. List
53+ * ` lc help <command> ` to see help on sub command.
54+ * ` lc <command> --help ` also works.
55+
56+ ### list
4657
4758Navigate all the problems. The heading ` ✔ ` means you have AC-ed the problem.
4859
@@ -59,12 +70,23 @@ Navigate all the problems. The heading `✔` means you have AC-ed the problem.
5970 ✔ [ 1] Two Sum Easy (25.6%)
6071
6172* ` -q ` to filter by query conditions.
73+ * `e` = easy, `E` = m + h.
74+ * `m` = medium, `M` = e + h.
75+ * `h` = hard, `H` = e + m.
76+ * `d` = done = AC-ed, `D` = not AC-ed.
77+ * `l` = locked, `L` = not locked.
6278* ` -s ` to show statistic counters.
6379* ` lc list <keyword> ` to search by keyword.
6480
65- ### 3. Prepare
81+ * Example*
82+
83+ $ lc list -q Dml array
84+ 🔒 [360] Sort Transformed Array Medium (41.0%)
85+ 🔒 [325] Maximum Size Subarray Sum Equals k Medium (40.9%)
6686
67- Select one problem to fight. With ` -g ` +` -l ` , the code template could be auto generated for you.
87+ ### show
88+
89+ Select a problem to fight. With ` -g ` +` -l ` , the code template could be auto generated for you.
6890
6991 $ lc show 1 -g -l cpp
7092
@@ -101,15 +123,17 @@ Select one problem to fight. With `-g`+`-l`, the code template could be auto gen
101123 * python
102124 * ruby
103125 * swift
104- * Instead of index, you can use name to select one problem.
126+ * Instead of index number , you can use name to select a problem.
105127 * `lc show "Two Sum"`
106128 * `lc show two-sum`
107129
108- ### 4. Coding
130+ ### submit
109131
110- No trick, it's all your showtime!
132+ $ lc submit ./two-sum.cpp
133+ ✔ Accepted
134+ ✔ 16/16 cases passed (12 ms)
111135
112- ### 5. Test
136+ ### test
113137
114138Customize your testcase and run it against leetcode.
115139
@@ -132,11 +156,52 @@ Customize your testcase and run it against leetcode.
132156* ` -t ` to provide test case in command line.
133157* ` -i ` to provide test case in interactive mode.
134158
135- ### 6. Submit
159+ ### user
136160
137- $ lc submit ./two-sum.cpp
138- ✔ Accepted
139- ✔ 16/16 cases passed (12 ms)
161+ Login with your leetcode account (username or email).
162+
163+ $ lc user -l
164+ login: <account>
165+ pass:
166+ Successfully login as <account>
167+
168+ * ` -l ` to login
169+ * ` -L ` to logout.
170+ * ` -s ` to show user statistics.
171+ * ` lc user ` to show current account.
172+
173+ * Eaxmple*
174+
175+ $ lc user -s
176+ You are now login as skygragon
177+
178+ Easy 72/95 (75.79%) [+++++++++++++++++++++++.......]
179+ Medium 97/194 (50.00%) [+++++++++++++++...............]
180+ Hard 27/82 (32.93%) [++++++++++....................]
181+
182+ ### version
183+
184+ $ lc version
185+ 0.1.1
186+
187+ * ` -v ` to show verbose info, e.g. config, cache dir.
188+
189+ * Example*
190+
191+ $ lc version -v
192+ leetcode-cli 0.1.1
193+
194+ Cache: /Users/skygragon/.lc/
195+ Config: /Users/skygragon/.lcconfig
196+
197+ BASE_URL = https://leetcode.com
198+ LOGIN_URL = https://leetcode.com/accounts/login/
199+ PROBLEMS_URL = https://leetcode.com/problems/
200+ TEST_URL = https://leetcode.com/problems/$key/interpret_solution/
201+ SUBMIT_URL = https://leetcode.com/problems/$key/submit/
202+ VERIFY_URL = https://leetcode.com/submissions/detail/$id/check/
203+ LANG = cpp
204+ USE_COLOR = true
140205
141206## Tips
142207
@@ -158,12 +223,13 @@ Copy `.lc-completion.bash` to your home directory, and source it in .bashrc (Lin
158223
159224Or use configuration setting, see below.
160225
161-
162226### Configuration
163227
164- Create a file named ` .lcconfig ` in your home directory. Here is an example:
228+ Create a file named ` .lcconfig ` in your home directory.
229+
230+ * Example*
165231
166232 {
167233 "LANG": "java",
168234 "USE_COLOR": true
169- }
235+ }
0 commit comments