2 ms·
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,
by Chris_Newton 11y ago
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
[(1,2),(3,0),(4,0)]
when if I’ve understood correctly it should be
[(1,2),(3,1),(4,0)]
- pykello 11y agoYou are right. Thank you. Going to correct this.