Hacker News new | past | comments | ask | show | jobs | submit login

Perhaps I’ve misunderstood the problem, but the second solution shown here doesn’t seem to be correct: it always adds a trailing 0-height entry to the skyline, yet there could be an existing building touching or overlapping the newly added building, whose height is then lost.

For example, the code given appears to make

    skyline [(1, 2, 3), (2, 1, 4)]
evaluate to

when if I’ve understood correctly it should be


You are right. Thank you. Going to correct this.

Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact