mq032.会议室II Leetcode sort Dec 07, 2020 题目链接 做过了,纠结了一下写出来了,但是速度不是很快。这个算法的时间复杂度是O(NlogN),空间复杂度是O(N)。额想看一下别人的,结果发现时间复杂度和我这个一样的呀?? class Solution: def minMeetingRooms(self, intervals: List[List[int]]) -> int: tmp = [] for elem in intervals: tmp.append((elem[0], 1)) tmp.append((elem[1], -1)) ranked = sorted(tmp, key=lambda x: x) res = 0 record = 0 for t in ranked: record += t[1] res = max(res, record) return res PREVIOUSmq031.有效的括号NEXTmq033.前K个高频单词