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 building is represented by three values in the array buildings, where
lefti is the
righti is the
heighti is the height of the
All buildings are rectangles that sit on flat ground (height
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 building is represented by three values in the array buildings, where
lefti is the
righti is the
heighti is the height of the
All buildings are rectangles that sit on flat ground (height