Skip to content

Commit fc4029f

Browse files
authored
docs: Update README.md with configuration instructions (#130)
* docs: Update README.md with configuration instructions * docs: add configuration explanation
1 parent d121ac1 commit fc4029f

File tree

1 file changed

+101
-2
lines changed

1 file changed

+101
-2
lines changed

README.md

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ cargo install leetcode-cli
2424
<summary>Shell completions</summary>
2525

2626
For Bash and Zsh (by default picks up `$SHELL` from environment)
27+
2728
```sh
2829
eval "$(leetcode completions)"
2930
```
31+
3032
Copy the line above to `.bash_profile` or `.zshrc`
3133

3234
You may also obtain specific shell configuration using.
@@ -72,8 +74,16 @@ For example, given this config (could be found at `~/.leetcode/leetcode.toml`):
7274
[code]
7375
editor = 'emacs'
7476
# Optional parameter
75-
editor-args = ['-nw']
77+
editor_args = ['-nw']
7678
lang = 'rust'
79+
edit_code_marker = false
80+
start_marker = ""
81+
end_marker = ""
82+
# if include problem description
83+
comment_problem_desc = false
84+
# comment syntax
85+
comment_leading = ""
86+
test = true
7787

7888
[cookies]
7989
csrf = '<your-leetcode-csrf-token>'
@@ -86,6 +96,96 @@ root = '~/.leetcode'
8696
scripts = 'scripts'
8797
```
8898

99+
<details>
100+
<summary>Configuration Explanation</summary>
101+
102+
```toml
103+
[code]
104+
editor = 'emacs'
105+
# Optional parameter
106+
editor_args = ['-nw']
107+
lang = 'rust'
108+
edit_code_marker = true
109+
start_marker = "start_marker"
110+
end_marker = "end_marker"
111+
# if include problem description
112+
comment_problem_desc = true
113+
# comment syntax
114+
comment_leading = "//"
115+
test = true
116+
117+
[cookies]
118+
csrf = '<your-leetcode-csrf-token>'
119+
session = '<your-leetcode-session-key>'
120+
121+
[storage]
122+
cache = 'Problems'
123+
code = 'code'
124+
root = '~/.leetcode'
125+
scripts = 'scripts'
126+
```
127+
128+
If we change the configuration as shown previously, we will get the following code after `leetcode edit 15`.
129+
130+
```rust
131+
// Category: algorithms
132+
// Level: Medium
133+
// Percent: 32.90331%
134+
135+
// Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
136+
//
137+
// Notice that the solution set must not contain duplicate triplets.
138+
//
139+
//  
140+
// Example 1:
141+
//
142+
// Input: nums = [-1,0,1,2,-1,-4]
143+
// Output: [[-1,-1,2],[-1,0,1]]
144+
// Explanation:
145+
// nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.
146+
// nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.
147+
// nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.
148+
// The distinct triplets are [-1,0,1] and [-1,-1,2].
149+
// Notice that the order of the output and the order of the triplets does not matter.
150+
//
151+
//
152+
// Example 2:
153+
//
154+
// Input: nums = [0,1,1]
155+
// Output: []
156+
// Explanation: The only possible triplet does not sum up to 0.
157+
//
158+
//
159+
// Example 3:
160+
//
161+
// Input: nums = [0,0,0]
162+
// Output: [[0,0,0]]
163+
// Explanation: The only possible triplet sums up to 0.
164+
//
165+
//
166+
//  
167+
// Constraints:
168+
//
169+
//
170+
// 3 <= nums.length <= 3000
171+
// -10⁵ <= nums[i] <= 10⁵
172+
//
173+
174+
// start_marker
175+
impl Solution {
176+
pub fn three_sum(nums: Vec<i32>) -> Vec<Vec<i32>> {
177+
178+
}
179+
180+
}
181+
// end_marker
182+
183+
```
184+
185+
</details>
186+
187+
<br>
188+
89189
#### 1. <kbd>pick</kbd>
90190

91191
```sh
@@ -195,7 +295,6 @@ Open Firefox, press F12, and click `Storage` tab.
195295

196296
Expand `Cookies` tab on the left and select https://leetcode.com.
197297

198-
199298
#### Step 2
200299

201300
Copy `Value` from `LEETCODE_SESSION` and `csrftoken` to `session` and `csrf` in your configuration file, respectively:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy