@scurrlin/stencil 1.1.5 → 1.1.6

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 +14 -26
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -22,38 +22,26 @@ Solution
22
22
 
23
23
  ```python
24
24
  class Solution:
25
- def isValidBST(self, root: Optional[TreeNode]) -> bool:
26
- stack, prev = [], float("-inf")
27
-
28
- while root or stack:
29
- while root:
30
- stack.append(root)
31
- root = root.left
32
- root = stack.pop()
33
- if root.val <= prev:
34
- return False
35
- prev = root.val
36
- root = root.right
37
- return True
25
+ def isSameTree(self, p: TreeNode, q: TreeNode) -> bool:
26
+ if not p and not q:
27
+ return True
28
+ if p and q and p.val == q.val:
29
+ return self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right)
30
+ else:
31
+ return False
38
32
  ```
39
33
 
40
34
  Solution with Stencil
41
35
 
42
36
  ```python
43
37
  c S:
44
- d i(s, r: O[T]) -> b:
45
- s, p = [], f("-i")
46
-
47
- w r o s:
48
- w r:
49
- s.a(r)
50
- r = r.l
51
- r = s.p()
52
- i r.v <= p:
53
- r F
54
- p = r.v
55
- r = r.r
56
- r T
38
+ d i(s, p: T, q: T) -> b:
39
+ i n p a n q:
40
+ r T
41
+ i p a q a p.v == q.v:
42
+ r s.i(p.l, q.l) a s.i(p.r, q.r)
43
+ e:
44
+ r F
57
45
  ```
58
46
 
59
47
  ## Local Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
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": {