01 · Question
Given a rectangular RxC grid of integers, grid, with R > 0 and C > 0, return a new grid with the same dimensions where each cell [r, c] contains the maximum in the subgrid with [r, c] in the top-left corner and [R - 1, C - 1] in the bottom-right corner.
Example:
- Input:
grid = [[1, 5, 3], [4, -1, 0], [2, 0, 2]] - Output:
[[5, 5, 3], [4, 2, 2], [2, 2, 2]]