python solution runtime 78ms

  • 0
    def minMeetingRooms(self, intervals):
            rooms = 0
            meetings = []
            for i in sorted(intervals, key = lambda interval: interval.start):
                found = False
                for meeting in meetings:
                    if i.start >= meeting.end:
                        meeting.end = i.end
                        found = True
                if not found:
                    rooms += 1
            return rooms

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.