Sponsored
Use these hints if you're stuck. Try solving on your own first.
Run DFS from each non-zero cell.
Each time you pick a cell to start from, add up the number of fish contained in the cells you visit.
Solve with full IDE support and test cases