```python Definition for a binary tree node. class TreeNode: def init(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def maximumAverageSubtree(self, root: TreeNode) -> float: # time O(N) space O(H) “”” avg = sum(subtree) / # node, use post order traversal to get subtree...
[Read More]
1007. Minimum Domino Rotations For Equal Row
```python from collections import Counter class Solution: def minDominoRotations(self, A: List[int], B: List[int]) -> int: # time O(A+B) space O(1) cntA,cntB,same =Counter(A),Counter(B),Counter() if len(A) != len(B): return -1 for a,b in zip(A,B): if a == b : same[a] += 1 for v in range(1,7): if cntA[v] + cntB[v] - same[v]...
[Read More]
safely merge branch into master; delete branch
refer
[Read More]
Git error on commit after merge - fatal- cannot do a partial commit during a merge
Solution:
I found that adding “-i” to the commit command fixes this problem for me. The -i basically tells it to stage additional files before committing. That is:
[Read More]
Add repository to fix npm WARN No repository field
when using npm install to completes the job, but I get this warning:
npm WARN @1.0.0 No repository field.
[Read More]