Search⌘ K
AI Features

The Skyline Problem

Explore how to solve the Skyline Problem by analyzing building coordinates and heights to produce a skyline outline. This lesson helps you understand using the union find algorithm to effectively represent the combined silhouettes of overlapping buildings. You will learn how to create a list of height-changing points that form the city skyline, avoiding redundant horizontal segments.

Statement

Imagine standing at a distance, viewing the skyline of a city. The skyline is the shape formed by all the buildings in the city when viewed together. Your task is to determine the shape of this skyline, given all the buildings’ position and height. Each ...