YASH Technologies needs to estimate accumulated water between elevation bars represented in a project analytics view. Given an integer array height, where height[i] is the height of a bar with unit width, return the total amount of rainwater that can be trapped after raining.
For each position, trapped water is determined by the shorter of the tallest bar to its left and the tallest bar to its right, minus the current bar height. Use auxiliary arrays to store these left and right maximum values.
Implement trap_rain_water(height). The input is a list of non-negative integers, and the output is an integer representing the total trapped water.
def trap_rain_water(height):