grid. A value of -1 marks a blank. Replace every blank with the largest value in its column and return the resulting table.
Every column is guaranteed to contain at least one non-negative value.grid=[[5, -1], [-1, 3], [2, 7]] → [[5, 7], [5, 3], [2, 7]]
Column 0 has maximum 5, which fills the blank in row 1; column 1 has maximum 7, which fills the blank in row 0.
grid=[[0, 4], [0, 4]] → [[0, 4], [0, 4]]
There are no blanks, so the grid stays the same.
grid=[[5, -1], [-1, 3], [2, 7]]
[[5, 7], [5, 3], [2, 7]]
Run checks the first 3 tests in your browser. Submit checks all 69 tests on the server, hidden ones included.