You are given a n x n grid where n is odd, and each cell grid[r][c] contains a value of
A cell is considered part of the Letter Y if it belongs to any of the following segments:
The diagonal starting at the top-left cell and ending at the center cell of the grid.
The diagonal starting at the top-right cell and ending at the center cell of the grid.
The vertical line starting at the center cell and ending at the bottom border of the grid.
The Letter Y is considered written on the grid if and only if:
All cells belonging to Y share the same value.
All cells not belonging to Y share the same value.
The value of Y cells is different from the value of non-Y cells.
In one operation, you may change the value of any cell to grid.
Constraints:
n
n grid.length grid[i].length
grid[i][j]
n is odd
You are given a n x n grid where n is odd, and each cell grid[r][c] contains a value of
A cell is considered part of the Letter Y if it belongs to any of the following segments:
The diagonal starting at the top-left cell and ending at the center cell of the grid.
The diagonal starting at the top-right cell and ending at the center cell of the grid.
The vertical line starting at the center cell and ending at the bottom border of the grid.
The Letter Y is considered written on the grid if and only if:
All cells belonging to Y share the same value.
All cells not belonging to Y share the same value.
The value of Y cells is different from the value of non-Y cells.
In one operation, you may change the value of any cell to grid.
Constraints:
n
n grid.length grid[i].length
grid[i][j]
n is odd