FunctionRacerProblemsRace

Largest Open Plot

MediumStacks and queuesPython, JavaScript, TypeScript, Java, C++

field is a map of a farm given as a list of equal-length strings, where . is open ground and # is a rock. A plot is a rectangle of cells, aligned with the grid, that holds open ground only.

Return the number of cells in the largest plot, or 0 if there is no open ground.

Example 1

field ["..#..",".....","#...."]
returns 8

Rows 1 and 2 with columns 1 to 4 form an open plot of 2 by 4 cells.

Example 2

field ["#"]
returns 0

The only cell is a rock.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Stacks and queues problems