The Skyline Problem

easy
1. You will be given a matrix with 3 coloumns, containing dimensions of buidings and matrix dimensions.
 2. First coloumn is starting point(x1), second is ending on x-axis, and third is height of each building 
 3. You need to find the outline height and width coordinates of the group of buildings or city skyline
 4. Input and output is handled for you
 5. It is a functional problem ,please do not modify main()

Input Format

Input is handled for you.

Output Format

Output is handled for you.

Constraints

1 <= Length of building matrix <= 10^4
 The input list is already sorted in ascending order by the left x position x1

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
3 3
3 8 3 
8 7 10  
8 10 7
Output
[[3, 3], [8, 10]]
Previous
Longest Subarray With Sum Divisible By K
Next
Word Pattern

Related Questions