标签:type code etc max object bsp int grid lin
class Solution(object): def maxIncreaseKeepingSkyline(self, grid): """ :type grid: List[List[int]] :rtype: int """ import numpy as np grid=np.array(grid) ori=grid.sum() for i, _ in enumerate(grid): for j, _ in enumerate(grid[i]): grid[i][j] = min(max(grid[i]), max(grid[:,j])) print(grid) ans=0 for i,_ in enumerate(grid): ans+=sum(grid[i]) return ans-ori
Leetcode 807. Max Increase to Keep City Skyline
标签:type code etc max object bsp int grid lin
原文地址:https://www.cnblogs.com/zywscq/p/10652718.html