Tianpei Yang
Tianpei Yang
## 105 ```python # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class...
```python class Solution: def minCost(self, cost): res=[[-1, 0], [-1, 0]] for x in cost: curRes=[[-1,float('Inf')], [-1,float('Inf')]] for i, y in enumerate(x): if i!=res[0][0]: temp=y+res[0][1] else: temp=y+res[1][1] if temp
```python class Solution(object): def countSmaller(self, nums): """ :type nums: List[int] :rtype: List[int] """ def mergeSort(indexes): half = len(indexes) // 2 if half: left, right = mergeSort(indexes[:half]), mergeSort(indexes[half:]) for i in...