
[LeetCode] 2658. Maximum Number of Fish in a Grid (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents:A land cell if grid[r][c] = 0, orA water cell containing grid[r][c] fish, if grid[r][c] > 0.A fisher can start at any water cell (r, c) and can do the following operations any number of times:Catch all the fish at cell (r, c), orMove to any adjacent water cell.Return the maximum number of fish the fis..