The Largest Lake
Same map — print the area (cell count) of the largest lake, or 0 if there is no water.
Input: the first line has N and M; the next N lines each have M characters (L/W).
Output: the largest lake's area.
Constraints:
- 1 ≤ N, M ≤ 500
Sample Tests
Input 1
3 4 LWWL LLWL WLLL
Output 1
3
Input 2
2 2 LL LL
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.