695. Max Area of Island
This is similar to 695. Max Area of Island.\n\nFor each "island" of water, it does not matter where fisherman starts. We just need to mark a visited cell by set
This is similar to [695. Max Area of Island](https://leetcode.com/problems/max-area-of-island/).\n\nFor each "island" of water, it does not matter where fisherman starts. We just need to mark a visited cell by setting it to zero.\n\n```cpp    \nint dfs(int r, int c, vector<vector<int>>& g) {\n    if (min(r, c) < 0 || r == g.size() || c == g[r].size() || g[r][c] == 0)\n        return 0;\n    return exchange(g[r][c], 0) + dfs(r + 1, c, g) + dfs(r, c + 1, g) + dfs(r - 1, c, g) + dfs(r, c - 1, g);\n}\nint findMaxFish(vector<vector<int>>& g) {\n    int res = 0;\n    for (int r = 0; r < g.size(); ++r)\n        for (int c = 0; c < g[r].size(); ++c)\n            res = max(res, dfs(r, c, g));\n    return res;\n}\n```
[]