You are given a grid of size m n, where:
grid[r][c] =
grid[r][c] > grid[r][c] fish.
A fisher can start at any water cell (r, c) and perform the following operations:
Catch all the fish at the current cell (r, c).
Move to any adjacent water cell in the four cardinal directions (up, down, left, or right).
The fisher can continue moving to adjacent water cells that have not yet been visited.
Return the maximum number of fish the fisher can collect. If there are no water cells in grid, return
Constraints:
m == grid.length
n == grid[i].length
m, n
grid[i][j]
You are given a grid of size m n, where:
grid[r][c] =
grid[r][c] > grid[r][c] fish.
A fisher can start at any water cell (r, c) and perform the following operations:
Catch all the fish at the current cell (r, c).
Move to any adjacent water cell in the four cardinal directions (up, down, left, or right).
The fisher can continue moving to adjacent water cells that have not yet been visited.
Return the maximum number of fish the fisher can collect. If there are no water cells in grid, return
Constraints:
m == grid.length
n == grid[i].length
m, n
grid[i][j]