Create a list of all building edges (both left and right) along with their heights (positive for left, negative for right).
Sort the edges by their x-coordinate.
Initialize a priority queue (max-heap) to keep track of the current building heights intersecting the sweep line.
Initialize a variable to keep track of the previous maximum height (initialized to 0).
Iterate over the sorted edges:
a. If the edge is a left edge, add its height to the priority queue.
b. If the edge is a right edge, remove the corresponding height from the priority queue.
c. After adding/removing the height, check the current maximum height in the priority queue.
d. If the current maximum height is different from the previous maximum height, add a key point to the result.
e. Update the previous maximum height.