TheMatrix
SRM 610 · 2013-12-22 · by rng_58
Problem Statement
Have you ever had a dream, that you were so sure was real? What if you were unable to wake from that dream? How would you know the difference between the dream world and the real world?
To answer this complex puzzle, one of the questions that must be answered is to find out whether the world that you live in can be represented by a chess matrix.
Cells of a matrix are called adjacent if they share an edge. A matrix of zeroes and ones is called a chess matrix if there are no two adjacent cells that share the same value. Hence, in a chess matrix the zeroes and ones have to alternate in the same way the colors alternate on a chessboard:

You are given a
Constraints
- board will contain between 1 and 100 elements, inclusive.
- Each element of the board is a string containing between 1 and 100 characters, inclusive.
- All elements of board will have the same length.
- Each character of each element of board will be either '0' or '1'.
{"1",
"0"}
Returns: 2
The entire board is a chess matrix.
{"0000"}
Returns: 1
The largest possible chess matrix here is just a single cell.
{"01"}
Returns: 2
Again, the entire board is a chess matrix.
{"001",
"000",
"100"}
Returns: 2
Each rectangular subgrid is determined by a contiguous range of rows and a contiguous range of columns. The four corners of this grid do not form a valid rectangular subgrid.
{"0"}
Returns: 1
Submissions are judged against all 208 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class TheMatrix with a public method int MaxArea(vector<string> board) · 208 test cases · 2 s / 256 MB per case