Update 807 solution

This commit is contained in:
halfrost
2021-12-21 21:21:21 +08:00
parent fc8c6a546e
commit a5d665ce01
5 changed files with 112 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# [807. Max Increase to Keep City Skyline](https://leetcode-cn.com/problems/max-increase-to-keep-city-skyline/)
# [807. Max Increase to Keep City Skyline](https://leetcode.com/problems/max-increase-to-keep-city-skyline/)
## 题目
@ -47,10 +47,10 @@ Return the maximum total sum that the height of the buildings can be increased b
## 解题思路
- 从数组竖直方向即顶部底部看“天际线”计算出topBottomSkyline
- 从数组水平方向即左侧右侧看“天际线”计算出leftRightSkyline
- 计算grid中每个元素与对应的topBottomSkylineleftRightSkyline中较小值的差值
- 统计所有差值的总和ans并返回
- 从数组竖直方向(即顶部,底部)看“天际线”计算出 topBottomSkyline
- 从数组水平方向(即左侧,右侧)看“天际线”计算出 leftRightSkyline
- 计算 grid 中每个元素与对应的 topBottomSkylineleftRightSkyline 中较小值的差值
- 统计所有差值的总和 ans 并返回
## 代码