You are given a buildings where buildings[i] start_i, end_i, height_istart_i, end_iheight_i.
The average height of a segment is defined as the total sum of heights of all buildings present in that segment divided by the total number of buildings in that segment, rounded down to the nearest integer.
Return a sorted list of non overlapping segments start, end, avg_heightstart in ascending order such that:
Every point within start, end
The average height avg_height is identical for all points within start, end
There are no two adjacent segments with the same average height that share a boundary point (adjacent segments with the same average height must be merged into a single segment).
Intervals with no buildings are omitted from the output.
Constraints:
buildings.length
buildings[i].length
start_i end_i
height_i
You are given a buildings where buildings[i] start_i, end_i, height_istart_i, end_iheight_i.
The average height of a segment is defined as the total sum of heights of all buildings present in that segment divided by the total number of buildings in that segment, rounded down to the nearest integer.
Return a sorted list of non overlapping segments start, end, avg_heightstart in ascending order such that:
Every point within start, end
The average height avg_height is identical for all points within start, end
There are no two adjacent segments with the same average height that share a boundary point (adjacent segments with the same average height must be merged into a single segment).
Intervals with no buildings are omitted from the output.
Constraints:
buildings.length
buildings[i].length
start_i end_i
height_i