@scurrlin/stencil 1.22.8 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,28 +16,46 @@ Whether you are studying for technical interviews, or just starting your coding
16
16
 
17
17
  Most people when they attempt to memorize something study the full text and then attempt to regurgitate it on a blank page. Shocking, I know... but what if there was a step in between? What if memorization and pattern recognition weren't all or nothing games? This is where Stencil comes in.
18
18
 
19
- Stencil is a language-agnostic memorization tool that strips code files down to their first letters while preserving spacing, capitalization, and punctuation. The "stencil" of the file is designed to act as a bridge between having something partially memorized and fully memorized. Below is an example of Stencil in action using LeetCode problem 197 "Rising Temperature":
19
+ Stencil is a language-agnostic memorization tool that strips code files down to their first letters while preserving spacing, capitalization, and punctuation. The "stencil" of the file is designed to act as a bridge between having something partially memorized and fully memorized. Below is an example of Stencil in action using LeetCode problem 199 "Binary Tree Right Side View":
20
20
 
21
21
  ## Example
22
22
 
23
23
  Solution
24
24
 
25
- ```sql
26
- SELECT w1.id
27
- FROM Weather w1
28
- JOIN Weather w2
29
- ON DATE_SUB(w1.recordDate, INTERVAL 1 DAY) = w2.recordDate
30
- WHERE w1.temperature > w2.temperature;
25
+ ```python
26
+ class Solution:
27
+ def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
28
+ if not root:
29
+ return []
30
+
31
+ view = []
32
+ def dfs(node, level):
33
+ if node:
34
+ if level == len(view):
35
+ view.append(node.val)
36
+ dfs(node.right, level + 1)
37
+ dfs(node.left, level + 1)
38
+ dfs(root, 0)
39
+ return view
31
40
  ```
32
41
 
33
42
  Solution with Stencil
34
43
 
35
- ```sql
36
- S w.i
37
- F W w
38
- J W w
39
- O D_S(w.r, I 1 D) = w.r
40
- W w.t > w.t;
44
+ ```python
45
+ c S:
46
+ d r(s, r: O[T]) -> L[i]:
47
+ i n r:
48
+ r []
49
+
50
+ v = []
51
+ d d(n, l):
52
+ i n:
53
+ i l == l(v):
54
+ v.a(n.v)
55
+ d(n.r, l + 1)
56
+ d(n.l, l + 1)
57
+ d(r, 0)
58
+ r v
41
59
  ```
42
60
 
43
61
  ## Local Installation
@@ -51,7 +69,7 @@ npm install @scurrlin/stencil
51
69
  Once installed, you can run it with the following command:
52
70
 
53
71
  ```bash
54
- npx stencil path/to/your/file.sql --start <start_line> --end <end_line>
72
+ npx stencil path/to/your/file.py --start <start_line> --end <end_line>
55
73
  ```
56
74
 
57
75
  ## Global Installation
@@ -65,5 +83,5 @@ npm install -g @scurrlin/stencil
65
83
  Once installed, you can run it with the following command:
66
84
 
67
85
  ```bash
68
- stencil path/to/your/file.sql --start <start_line> --end <end_line>
86
+ stencil path/to/your/file.py --start <start_line> --end <end_line>
69
87
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.22.8",
3
+ "version": "1.23.0",
4
4
  "description": "A memorization tool that strips code down to first letters and punctuation only.",
5
5
  "main": "src/index.js",
6
6
  "bin": {