Tap here to switch tabs
Problem
Submissions

Problem: Trapping Rain Water II

med
30 min
Try to solve the Trapping Rain Water II problem.

Statement

Given an m×nm \times n integer matrix heightMap, where each cell represents the height of a unit cell in a 2D elevation map, return the total volume of water that can be trapped after raining.

Constraints:

  • m == heightMap.length

  • n == heightMap[i].length

  • 11 \leq m, n 200\leq 200

  • 00 \leq heightMap[i][j] 2×104\leq 2 \times 10^4

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Trapping Rain Water II

med
30 min
Try to solve the Trapping Rain Water II problem.

Statement

Given an m×nm \times n integer matrix heightMap, where each cell represents the height of a unit cell in a 2D elevation map, return the total volume of water that can be trapped after raining.

Constraints:

  • m == heightMap.length

  • n == heightMap[i].length

  • 11 \leq m, n 200\leq 200

  • 00 \leq heightMap[i][j] 2×104\leq 2 \times 10^4

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths