You're given a D grid of s (water) and s (land). An island is a group of s connected horizontally or vertically. Your task: find the island with the largest area and return that area. If there is no island, return .
For example, a grid might contain islands of sizes , , and . You'd return . This is different from Number of Islands, where you counted components. Here, you need to measure each one and track the maximum.
You already know how to find connected components with DFS. The new challenge is making DFS return a value: the size of the component it explores.