0407. Trapping Rain Water II

https://leetcode.com/problems/trapping-rain-water-ii

Description

Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.

Example 1:

Example 2:

Constraints:

  • m == heightMap.length

  • n == heightMap[i].length

  • 1 <= m, n <= 200

  • 0 <= heightMap[i][j] <= 2 * 104

ac

Last updated

Was this helpful?