class Solution(object): def trapRainWater(self, heightMap): """ :type heightMap: List[List[int]] :rtype: int """ Max = 0 Min = 99999999999999999 nrow = len(heightMap) ncol = len(heightMap[0]) if nrow>0 else 0 for i in range(nrow): for j in range(ncol): Min = min(Min,heightMap[i][j]) Max = max(Max,heightMap[i][j]) def isBorder(x,y): return x==0 or x==nrow-1 or y==0 or y==ncol-1 def valid(x,y): return x>=0 and x=0 and y=h: continue q = [(i,j)] qh = 0 qt = 1 while qh