You have a matrix of non-negative integers representing land heights. A pond is defined by contiguous cells of height 0 (connected 4-directionally). Return a list of the sizes of all ponds (areas of connected zeros). This is similar to counting connected components via DFS.
2D list of ints (>=0).
List of pond sizes (ints).
Example 1:
Input:
land = [[0,2,1],[0,0,1],[1,1,0]]
Output:
[4]
Explanation:
There is one pond of size 3 (three zeros connected) and one of size 1.