 Maximum Number of Fish in a Grid (DFS )
Code
# Code
```javascript []
/**
 * @param {number[][]} grid
 * @return {number}
 */
var findMaxFish = function(grid) {
    if (!grid || grid.length === 0) return 0;
    let rows = grid.length
    let cols = grid[0].length
    let max = 0;
    function dfs(i, j){
       if (i < 0 || i >= rows || j < 0 || j >= cols || grid[i][j] === 0) {
            return 0;
        }
        const fishCount = grid[i][j];
        grid[i][j] = 0;
        return fishCount + dfs(i + 1, j) + dfs(i - 1, j) + dfs(i, j + 1) + dfs(i, j - 1);
    }
    for(let i = 0; i < rows; i++){
       for(let j = 0; j < cols; j++){ 
            const currentFishCount = dfs(i, j)
            max = Math.max(max, currentFishCount)
       }
    }   
    return max
};
```
['Depth-First Search', 'JavaScript']