Given n non-negative integers representing an elevation map where the width of each bar is 1. Write a function to measure how much water it is able to trap this elevation map after raining.
Given elevation map: [0,1,0,2,1,0,1,3,2,1,2,1].
Rain...
const elevationMap = [0,1,0,2,1,0,1,3,2,1,2,1];
trapRainWater(elevationMap); //6