Max Area of Island

Hard · rating 1750 · Graphs

The first line has r and c. The next r lines are strings of c characters (0 or 1). Print the number of cells in the largest 4-connected group of 1s (0 if there are none).

Constraints: 1 ≤ r, c ≤ 1000

Related problems

Open Max Area of Island in Code Arena →