@@ -60,7 +60,7 @@ def employeeFreeTime(self, schedule: List[List[List[int]]]) -> List[List[int]]:
6060
6161 Similar to meeting rooms II
6262 """
63- max_end = min (
63+ cur_max_end = min (
6464 itv [E ]
6565 for itvs in schedule
6666 for itv in itvs
@@ -76,10 +76,10 @@ def employeeFreeTime(self, schedule: List[List[List[int]]]) -> List[List[int]]:
7676 while q :
7777 _ , i , j = heapq .heappop (q )
7878 itv = schedule [i ][j ]
79- if max_end < itv [S ]:
80- ret .append ([max_end , itv [S ]])
79+ if cur_max_end < itv [S ]:
80+ ret .append ([cur_max_end , itv [S ]])
8181
82- max_end = max (max_end , itv [E ])
82+ cur_max_end = max (cur_max_end , itv [E ])
8383
8484 # next
8585 j += 1
@@ -122,7 +122,7 @@ def employeeFreeTime_error(self, schedule: List[List[List[int]]]) -> List[List[i
122122 use index instead
123123 """
124124 schedules = list (map (iter , schedule ))
125- max_end = min (
125+ cur_max_end = min (
126126 itv [E ]
127127 for emp in schedule
128128 for itv in emp
@@ -136,9 +136,9 @@ def employeeFreeTime_error(self, schedule: List[List[List[int]]]) -> List[List[i
136136 ret = []
137137 while q :
138138 _ , itv , emp_iter = heapq .heappop (q )
139- if max_end < itv [S ]:
140- ret .append ([max_end , itv [S ]])
141- max_end = max (max_end , itv [E ])
139+ if cur_max_end < itv [S ]:
140+ ret .append ([cur_max_end , itv [S ]])
141+ cur_max_end = max (cur_max_end , itv [E ])
142142 itv = next (emp_iter , None )
143143 if itv :
144144 heapq .heappush (q , (itv [S ], itv , emp_iter ))
0 commit comments