Concise DFS | C++
\nclass Solution {\n    vector<int> dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1};\n    int dfs(int i, int j, vector<vector<int>>& grid, vector<vector<int>>& vis, int 
```\nclass Solution {\n    vector<int> dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1};\n    int dfs(int i, int j, vector<vector<int>>& grid, vector<vector<int>>& vis, int n, int m) {\n        vis[i][j] = 1;\n        int cnt = grid[i][j];\n        \n        for(int k=0; k<4; k++) {\n            int x = i + dx[k], y = j + dy[k];\n            if(x >= 0 && x < n && y >= 0 && y < m && grid[x][y] > 0 && !vis[x][y]) {\n                cnt += dfs(x, y, grid, vis, n, m);\n            }\n        }\n        return cnt;\n    }\npublic:\n    int findMaxFish(vector<vector<int>>& grid) {\n        int n = grid.size(), m = grid[0].size(), ans = 0;\n        vector<vector<int>> vis(n, vector<int>(m));\n        \n        for(int i=0; i<n; i++) {\n            for(int j=0; j<m; j++) {\n                if(grid[i][j] > 0 && !vis[i][j]) {\n                    ans = max(ans, dfs(i, j, grid, vis, n, m));\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Depth-First Search', 'C++']