@scurrlin/stencil 1.33.8 → 1.34.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 +13 -21
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,7 +16,7 @@ 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 354 "Russian Doll Envelopes":
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 357 "Count Numbers with Unique Digits":
20
20
 
21
21
  ## Example
22
22
 
@@ -24,32 +24,24 @@ Solution
24
24
 
25
25
  ```python
26
26
  class Solution:
27
- def maxEnvelopes(self, envelopes: List[List[int]]) -> int:
28
- envelopes.sort(key = lambda x: (x[0], -x[1]))
29
- res = []
30
- for _, h in envelopes:
31
- idx = bisect_left(res, h)
32
- if idx == len(res):
33
- res.append(h)
34
- else:
35
- res[idx] = h
36
- return len(res)
27
+ def countNumbersWithUniqueDigits(self, n: int) -> int:
28
+ res, prev = 10, 9
29
+ for i in range(1, n):
30
+ prev *= 10 - i
31
+ res += prev
32
+ return n and res or 1
37
33
  ```
38
34
 
39
35
  Solution with Stencil
40
36
 
41
37
  ```python
42
38
  c S:
43
- d m(s, e: L[L[i]]) -> i:
44
- e.s(k = l x: (x[0], -x[1]))
45
- r = []
46
- f _, h i e:
47
- i = b_l(r, h)
48
- i i == l(r):
49
- r.a(h)
50
- e:
51
- r[i] = h
52
- r l(r)
39
+ d c(s, n: i) -> i:
40
+ r, p = 1, 9
41
+ f i i r(1, n):
42
+ p *= 1 - i
43
+ r += p
44
+ r n a r o 1
53
45
  ```
54
46
 
55
47
  ## Local Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.33.8",
3
+ "version": "1.34.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": {