# ---
# title: 407. Trapping Rain Water II
# id: problem407
# author: Tian Jun
# date: 2020-10-31
# difficulty: Hard
# categories: Heap, Breadth-first Search
# link: <https://leetcode.com/problems/trapping-rain-water-ii/description/>
# hidden: true
# ---
# 
# Given an `m x n` matrix of positive integers representing the height of each
# unit cell in a 2D elevation map, compute the volume of water it is able to
# trap after raining.
# 
# **Example:**
# 
#     
#     
#     Given the following 3x6 height map:
#     [
#       [1,4,3,1,3,2],
#       [3,2,1,3,2,4],
#       [2,3,3,2,3,1]
#     ]
#     
#     Return 4.
#     
# 
# ![](https://assets.leetcode.com/uploads/2018/10/13/rainwater_empty.png)
# 
# The above image represents the elevation map
# `[[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]]` before the rain.
# 
# 
# 
# ![](https://assets.leetcode.com/uploads/2018/10/13/rainwater_fill.png)
# 
# After the rain, water is trapped between the blocks. The total volume of water
# trapped is 4.
# 
# 
# 
# **Constraints:**
# 
#   * `1 <= m, n <= 110`
#   * `0 <= heightMap[i][j] <= 20000`
# 
# 
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end
