```
import numpy as np
class Solution(object):
def minDistance(self, height, width, tree, squirrel, nuts):
nuts2tree = abs(np.array(nuts) - tree).sum(1)
nuts2sqrl = abs(np.array(nuts) - squirrel).sum(1)
return int(2 * sum(nuts2tree) - max(nuts2tree - nuts2sqrl))
```