Python, classic solution with stack
IntuitionFew steps:
determind cells with water
for next available cell in water do explore with counting fish
compute max per "pond"
ApproachComplexity

Time co
# Intuition
Few steps:

- determind cells with water
- for next available cell in water do explore with counting fish
- compute max per "pond"

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(N)

- Space complexity:
O(N)

# Code
```python3 []
class Solution:
    def findMaxFish(self, grid: List[List[int]]) -> int:
        water = set()
        m = len(grid)
        n = len(grid[0])

        for row_id, r in enumerate(grid):
            for col_id, v in enumerate(r):
                if v:
                    water.add((row_id, col_id))

        
        def catch(r,c)->int:
            cnt_fish = 0
            Q = [[r,c]]

            while Q:
                r,c = Q.pop()
                cnt_fish +=grid[r][c]
                grid[r][c] = 0

                if (r,c) in water:
                    water.remove((r,c))
                
                #print("",r,c, cnt_fish, grid)
                for r, c in [[r-1, c], [r+1, c], [r, c-1], [r, c+1]]:
                    if 0<=r<m and 0<=c<n and grid[r][c]:
                        Q.append([r, c])

            return cnt_fish

        max_catch = 0
        while water:
            r,c = water.pop()            
            cnt_fish = catch(r,c)            
            max_catch = max(cnt_fish, max_catch)
        
        return max_catch

```
['Python3']