Trapping Rain Water problem not available. #2166
Open
Labels
Comments
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A common Google interview question known as the Trapping Rain Water problem where given an array of some non negative integers which represents the height of the block. Considering the width of each block to be 1 we need to find how much water could be trapped between the blocks during the rainy season.
Test Case:
Consider an array of size 6 and the heights of blocks be {3,0,0,2,0,4}
Thus the output should be 10.
Which accounts for the total trapped water of 3+3+1+3
The text was updated successfully, but these errors were encountered: