algo4: stack: trapping_rain_water: Simplified code