Open OverflowCat opened 2 years ago
这样做无法判断进出
from heapq import *
class Solution:
def getSkyline(self, buildings: List[List[int]]) -> List[List[int]]:
dots = set()
for b in buildings:
dots.add((b[0], b[2], True))
dots.add((b[1], b[2], False))
dots.add((b[0], 0))
dots.add((b[1], 0))
dots = sorted(list(dots), key=lambda x: x[0])
return dots