Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Pacific Atlantic Water Flow
Bookmark
Input
LeetCode Example
All Equal
Valley Center
Increasing
Custom
heights
=
[[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]]
Pacific
Atlantic
Both
Pacific Ocean
Pacific Ocean
Atlantic Ocean
Atlantic Ocean
0
1
2
3
4
0
1
2
3
4
1
2
2
3
5
3
2
3
4
4
2
4
5
3
1
6
7
1
4
5
5
1
1
2
4
algo
master
.
io
Step:
Start: Find cells that can reach both Pacific and Atlantic oceans
0 / 168
Input
LeetCode Example
All Equal
Valley Center
Increasing
Custom
heights
=
[[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]]
0 / 168
Pacific
Atlantic
Both
Pacific Ocean
Pacific Ocean
Atlantic Ocean
Atlantic Ocean
0
1
2
3
4
0
1
2
3
4
1
2
2
3
5
3
2
3
4
4
2
4
5
3
1
6
7
1
4
5
5
1
1
2
4
algo
master
.
io
Step:
Start: Find cells that can reach both Pacific and Atlantic oceans