Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Trapping Rain Water
Bookmark
Input
Example 1
Deep valley
Rising peaks
Custom
heights
=
[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]
0
0
1
1
0
2
2
3
1
4
0
5
1
6
3
7
2
8
1
9
2
10
1
11
water = 0
algo
master
.
io
Step:
Start of algorithm
0 / 35
Input
Example 1
Deep valley
Rising peaks
Custom
heights
=
[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]
0 / 35
0
0
1
1
0
2
2
3
1
4
0
5
1
6
3
7
2
8
1
9
2
10
1
11
water = 0
algo
master
.
io
Step:
Start of algorithm