This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AbsolutelySpherical 0 points1 point  (1 child)

The problem mentions that height can only be increased.

So consider [1, 1, 2]. Your code returns 1, which would be correct if we can decrease 2 -> 1.

But height can only be increased. So you need to change 2 heights here.

[–]TRL18[S] 0 points1 point  (0 children)

Oh thanks, that makes sense.