#C11212. Largest Single Digit Subgrid
Largest Single Digit Subgrid
Largest Single Digit Subgrid
You are given an M by N grid where each cell contains a digit between 0 and 9. Your task is to compute the area of the largest rectangular sub-grid in which all cells contain the same digit.
More formally, if a sub-grid is defined by its height and width, the area is given by: $$\text{area} = \text{width} \times \text{height}$$ Find the maximum possible area of a sub-grid where every cell has the identical digit.
Example:
Input: 4 5 11111 12221 12221 11111</p>Output: 6
In the above example, the maximum sub-grid containing a single digit has an area of 6.
inputFormat
The first line contains two space-separated integers M and N indicating the number of rows and columns respectively. Each of the next M lines contains a string of exactly N digits (0-9) representing a row of the grid.
For example:
4 5 11111 12221 12221 11111
outputFormat
Output a single integer representing the area of the largest rectangular sub-grid that contains only one distinct digit.
## sample4 5
11111
12221
12221
11111
6