DIY: Trapping Rainwater

Solve the interview question "Trapping Rainwater" yourself in this lesson.

We'll cover the following...

Problem statement

We have n non-negative integers representing an elevation map where the width of each bar is 1. Compute how much water it can trap after raining.

Access this course and 1400+ top-rated courses and projects.