Given an array arr[] of N non-negative integers representing height of blocks at index i as Ai where the width of each block is 1. Compute how much water can be trapped in between blocks after raining.
Structure is like below:
| |
|_|
We can trap 2 units of water in the middle gap.
enter here if you have any details
problem link: https://practice.geeksforgeeks.org/problems/trapping-rain-water/0Program Name - RainwaterTrapping Problem (RainwaterTrapping.cpp)
Issue No.- #296
Type issue number after hash(#)
Checklist(self check)
[x] Yes, this task assigned to me.
[x] My code follows the style guidelines(Clean Code) of this project
[x] I have performed a self-review of my own code
[x] My Filename is in camelCase format
[x] I have added Problem statement, Problem link in file.
Description
Given an array arr[] of N non-negative integers representing height of blocks at index i as Ai where the width of each block is 1. Compute how much water can be trapped in between blocks after raining. Structure is like below: | | |_| We can trap 2 units of water in the middle gap. enter here if you have any details problem link: https://practice.geeksforgeeks.org/problems/trapping-rain-water/0 Program Name - RainwaterTrapping Problem (RainwaterTrapping.cpp) Issue No.- #296
Checklist(self check)