Very Easy Python solution 90%
\nclass Solution(object):\n    def trapRainWater(self, heightMap):\n        """\n        :type heightMap: List[List[int]]\n        :rtype: int\n        """\n   
```\nclass Solution(object):\n    def trapRainWater(self, heightMap):\n        """\n        :type heightMap: List[List[int]]\n        :rtype: int\n        """\n        if not heightMap:\n            return 0\n        \n        n = len(heightMap)\n        m = len(heightMap[0])\n        \n        h = []\n        grid = [[0]*m for _ in range(n)]\n        re = 0\n        \n        for i in range(n):\n            for j in range(m):\n                if i == 0 or j == 0 or i == n-1 or j == m-1:\n                    grid[i][j] = 1\n                    heapq.heappush(h, (heightMap[i][j], i, j))\n        \n        dx = [1,0,-1,0]\n        dy = [0,1,0,-1]\n        \n        while h:\n            curh, i, j = heapq.heappop(h)\n            for k in range(4):\n                x = i + dx[k]\n                y = j + dy[k]\n                if x < 0 or y < 0 or x >= n or y>= m:\n                    continue\n                if grid[x][y] == 0:\n                    grid[x][y] = 1\n                    if curh > heightMap[x][y]:\n                        re += curh - heightMap[x][y]\n                        heapq.heappush(h, (curh, x, y))\n                    else:\n                        heapq.heappush(h, (heightMap[x][y], x, y))\n        \n        return re\n                \n```
['Heap (Priority Queue)', 'Python']