Search
⌘K

Leetcode 2658. Maximum Number of Fish in a Grid

Given an m×n grid where positive cells contain fish and zeros are land, find the maximum total fish a fisher can collect by starting at any water cell and traversing its reachable adjacent water cells (up/down/left/right). This reduces to finding the connected component of positive cells with the largest sum (can be done with DFS/BFS; m,n ≤ 10).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.