def get_skyline(lrh):
skyline, live = [], []<EOL>i, n = <NUM_LIT:0>, len(lrh)<EOL>while i < n or live:<EOL><INDENT>if not live or i < n and lrh[i][<NUM_LIT:0>] <= -live[<NUM_LIT:0>][<NUM_LIT:1>]:<EOL><INDENT>x = lrh[i][<NUM_LIT:0>]<EOL>while i < n and lrh[i][<NUM_LIT:0>] == x:<EOL><INDENT>heapq.heappush(live, (-lrh[i][<NUM_LIT:2>], -lrh[i][<NUM_LIT:1>]))<EOL>i += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>x = -live[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>while live and -live[<NUM_LIT:0>][<NUM_LIT:1>] <= x:<EOL><INDENT>heapq.heappop(live)<EOL><DEDENT><DEDENT>height = len(live) and -live[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>if not skyline or height != skyline[-<NUM_LIT:1>][<NUM_LIT:1>]:<EOL><INDENT>skyline += [x, height],<EOL><DEDENT><DEDENT>return skyline<EOL>
Wortst Time Complexity: O(NlogN)
:type buildings: List[List[int]]
:rtype: List[List[int]]