Question: write a python program to solve above question. (Use Python programming language Only) Task 2: The Skyline Problem (Contents and images taken from [11] The

write a python program to solve above question. (Use Python programming language Only)
Task 2: The Skyline Problem (Contents and images taken from [11] The skyine problem is defined as given R rectangular buildings in a 2-dimensional city, compute the skyline of these buildings, eliminating hidden lines. The main task is to viow buildings from a side and remove all sections that are not visible All buildings share common bottom and every building can be represented by triplet (Left, Height, Right) [1. Left: 13 x coordinated ofleft side. * Height: is height of building. .Right is xcoordinate of right side ID For example,above buiding is representedas (1, 11,5). A skyline is a collection of rectangular strips. A rectangular strip is represented as a pair (left, height) where; .Left: isx coordinate ofleft side of strip Hoight: is height of strip. For example the above skyline is represented as ((1, 11). (3. 13)(9,0),(12, 7), (16, 3). 19, 18). (22, 3),(23, 13). (29, 0)). Your task is to develop an efficient algorithm and implement it in Python to solve this problenm. The solution should generate the resul with time complexity of nlog[n) or lower. That is an algorithm to output the skyline eiven the buildines. Input will be given as a nested list with each inner list containing three elements; left, height and right. The output should be a nested list with each inner list containing two elements; left and height. The signature of the method that implements your algorithm should be def Findskyline uildings) A sample input and the corresponding output is given below. Input: Buildings in a nested list ((1,11,5), (2,6,7), (3,13,9). (12,7,16), (14,3,25). (19,18,22), (23,13,29), (24,4,28)) 0 5 1015 20 25 30I Output: Skyline in a nested list ((1, 11), (3,13). (9,0),(12,7), (16, 3). (19,18). (22,3), (23, 13), (29, 0)) Samples inputs and the expected ouput for each input is shown in the following table Input Expected Output (3,7,8), (1,10,5)3,4,0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
