Example 1trap()InputCopyheight = [0,1,0,2,1,0,1,3,2,1,2,1]OutputCopy6WhyThe elevation map traps 6 units of rain water.