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