input: Write a Python function to check whether a 2D list grid meets the following criteria for each cell grid[i][j] in a matrix of size m by n: the cell is equal to the cell directly below it (if it exists), and different from the cell to its immediate right (if it exists). If all cells meet these conditions, return True; otherwise, return False.
  
  Examples:
  >>> grid = [[1,0,2],[1,0,2]]
  True
  >>> grid = [[1,1,1],[0,0,0]]
  False
  >>> grid = [[1],[2],[3]]
  False
  
  Constraints:
  1 <= n, m <= 10
  0 <= grid[i][j] <= 9
output: def check_grid(grid):
      m = len(grid)
      n = len(grid[0])
      for i in range(m):
          for j in range(n):
              if i + 1 < m and grid[i][j] != grid[i + 1][j]:
                  return False
              if j + 1 < n and grid[i][j] == grid[i][j + 1]:
                  return False
      return True