Company: Flipkart_8nov
Difficulty: medium
Rainwater Harvesting in Recharge Pit Problem Description After delivering a lecture on rainwater harvesting on Environment day, the Director of the Institute asks students to construct a recharge pit that allows rainwater harvesting on the ground in the backyard. The recharge pit is made up of N X M cells, where N is the number of departments and M is the number of students from each department. Each student has to raise or lower the soil level in the cell allotted to him/her to harvest rainwater. The students work as a team and decide the level of soil in each cell considering the slope of the land, porosity, and texture of the soil. After completing the work, the final layout is represented as integers where 0 represents ground level, -ve represents dug up areas and +ve represents raised areas. The integer value represents the height or depth of the soil level. Water can be trapped in a cell only if all the four sides of a cell are above the cell level. You are given an elevation map