看你们说
把最大能填的填进去
我填了 旧过了
==
def restoreMatrix(self, rowSum: List[int], colSum: List[int]) ->
List[List[int]]:
m, n = len(rowSum), len(colSum)
ans = [[0 for _ in range(n)] for _ in range(m)]
for i in range(m):
for j in range(n):
ans[i][j] = min(rowSum[i], colSum[j])
rowSum[i] -= ans[i][j]
colSum[j] -= ans[i][j]
return ans