Updated: 2024-03-12
1 min read
On This Page
class Solution:
def modifiedMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
m, n = len(matrix), len(matrix[0])
for j in range(n):
mx = max(matrix[i][j] for i in range(m))
for i in range(m):
if matrix[i][j] == -1:
matrix[i][j] = mx
return matrix