You are given a grid of size
Every cell is equal to the cell directly below it, such that grid[i][j] == grid[i + 1][j] for all valid indices.
Every cell is different from the cell directly to its right, such that grid[i][j] != grid[i][j + 1] for all valid indices.
Return true if all cells satisfy these conditions, or false otherwise.
Constraints:
grid[i][j]
You are given a grid of size
Every cell is equal to the cell directly below it, such that grid[i][j] == grid[i + 1][j] for all valid indices.
Every cell is different from the cell directly to its right, such that grid[i][j] != grid[i][j + 1] for all valid indices.
Return true if all cells satisfy these conditions, or false otherwise.
Constraints:
grid[i][j]