Search
⌘K

Leetcode 1840. Maximum Building Height

Given n buildings in a line with height1 = 0, nonnegative integer heights, adjacent height differences ≤ 1, and some positions having upper bounds, compute the maximum possible building height. Because n can be huge but restrictions are sparse, the problem reduces to propagating slope constraints between restricted points and computing the highest feasible peak between neighboring restrictions.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.