Simple java solution
Complexity\n- Time complexity: O(mn)\n\n- Space complexity: O(mn)\n\n# Code\n\nclass Solution {\n    public int findMaxFish(int[][] grid) {\n        int sum=0;\
# Complexity\n- Time complexity: $$O(m*n)$$\n\n- Space complexity: $$O(m*n)$$\n\n# Code\n```\nclass Solution {\n    public int findMaxFish(int[][] grid) {\n        int sum=0;\n        for(int i=0;i<grid.length;i++)\n        {\n            for(int j=0;j<grid[0].length;j++)\n            {\n                if(grid[i][j]!=0)\n                {\n                    int a[]=new int[1];\n                    task(grid,i,j,a);\n                    sum=Math.max(sum,a[0]);\n                }\n            }\n        }\n        return sum;\n    }\n    public void task(int grid[][], int i, int j, int a[])\n    {\n        if(i<0 || j<0 || i>=grid.length || j>=grid[0].length || grid[i][j]==0)\n        {\n            return;\n        }\n        a[0]+=grid[i][j];\n        grid[i][j]=0;\n        task(grid,i+1,j,a);\n        task(grid,i-1,j,a);\n        task(grid,i,j+1,a);\n        task(grid,i,j-1,a);\n    }\n}\n```
['Java']