Five Lines Only - According to the Hints
IntuitionJust use the Hints from the Problem description:💡Hint 1
Run DFS from each non-zero cell.💡Hint 2
Each time you pick a cell to start from, add up the num
# Intuition
Just use the Hints from the Problem description:

💡Hint 1
Run DFS from each non-zero cell.

💡Hint 2
Each time you pick a cell to start from, add up the number of fish contained in the cells you visit.



```javascript []
const deltas = [[1, 0], [-1, 0], [0, 1], [0, -1]];
var findMaxFish = function(grid) {
    const f = (i, j, v = grid[i]?.[j]) => 
        v ? (grid[i][j] = 0, deltas.reduce((s, [x, y]) => s + f(i + x, j + y), v)) : 0;
    return Math.max(...grid.map((row, i) => row.map((c, j) => c && f(i, j))).flat());
};
```

['JavaScript']