Leetcode 42. Trapping Rain Water

Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.
Input: height = [4,2,0,3,2,5]
Output: 9

--

--

--

CS new grad, 6 years experience related to supply chain management. Located in Bay area

Love podcasts or audiobooks? Learn on the go with our new app.

[LeetCode]Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree

READ/DOWNLOAD#$ SharePoint For Dummies (For Dummies (Computer/Tech)) FULL BOOK PDF & FULL AUDIOBOOK

Spring ’21 Release Highlights — Do More with Opportunity Products

Lab 1: Physical Computing

📦 Passbolt debian package

What, Why and Where of Kafka

Integrating Salesforce.com Data with Google Cloud Data Fusion

Azure Web App- Spring Boot Backend Service

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gary Chiang

Gary Chiang

CS new grad, 6 years experience related to supply chain management. Located in Bay area

More from Medium

Leetcode 1514. Path with Maximum Probability

Understanding Topological Sorting with Kahn’s Algo

Stacking Legoblocks into Stairs -Dynamic programming

Leetcode Q328. Odd Even Linked List (Q276)