Company: Media Net .
Difficulty: medium
Rainwater Harvesting Problem Description Given an N x M matrix of positive integers representing the height of each unit cell in a 2D elevation map. Return the volume of water it is able to trap after raining. Input Format: The first and the only argument given is the integer matrix A. Output Format: Return the volume of water that is trapped after raining. int Solution::solve(vector<vector<int>> &A) { } Examples Example 1: Input: A = [ [1, 4, 3, 1, 3, 2], [3, 2, 1, 3, 2, 4], [2, 3, 3, 2, 3, 1] ] Output: 4 Constraints 1 <= N, M <= 110 1 <= A[i] <= 19999