@scurrlin/stencil 1.34.6 → 1.34.7

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 +17 -17
  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 371 "Sum of Two Integers":
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 372 "Super Pow":
20
20
 
21
21
  ## Example
22
22
 
@@ -24,28 +24,28 @@ Solution
24
24
 
25
25
  ```python
26
26
  class Solution:
27
- def getSum(self, a: int, b: int) -> int:
28
- mask = 0xffffffff
29
- while (b & mask) > 0:
30
- carry = ( a & b ) << 1
31
- a = (a ^ b)
32
- b = carry
33
-
34
- return (a & mask) if b > 0 else a
27
+ def superPow(self, a: int, b: List[int]) -> int:
28
+ exp = 0
29
+ for e in b:
30
+ exp = e + 10 * exp
31
+ exp %= 1140
32
+ if exp == 0:
33
+ exp = 1140
34
+ return pow(a, exp, 1337)
35
35
  ```
36
36
 
37
37
  Solution with Stencil
38
38
 
39
39
  ```python
40
40
  c S:
41
- d g(s, a: i, b: i) -> i:
42
- m = 0
43
- w (b & m) > 0:
44
- c = ( a & b ) << 1
45
- a = (a ^ b)
46
- b = c
47
-
48
- r (a & m) i b > 0 e a
41
+ d s(s, a: i, b: L[i]) -> i:
42
+ e = 0
43
+ f e i b:
44
+ e = e + 1 * e
45
+ e %= 1
46
+ i e == 0:
47
+ e = 1
48
+ r p(a, e, 1)
49
49
  ```
50
50
 
51
51
  ## Local Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.34.6",
3
+ "version": "1.34.7",
4
4
  "type": "module",
5
5
  "description": "A memorization tool that strips code down to first letters and punctuation only.",
6
6
  "main": "dist/src/index.js",