Company: MediaNet_july
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 that is able to trap after raining. Input: The first and the only argument given is the integer matrix A. Output: Return the volume of water that is trapped after raining. 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 The method signature for the solution is: int Solution::solve(vector<vector<int>> &A) { }