Free written solutionMax Increase to Keep City Skyline (LeetCode 807): Solution and Explanation
Each building sits in one row skyline and one column skyline. It can grow up to the smaller of those two maxima, and raising every building to that limit keeps both views unchanged.
Read the intuition, approach, code and complexity →