@@ -60,7 +60,7 @@ def employeeFreeTime(self, schedule: List[List[List[int]]]) -> List[List[int]]:
60
60
61
61
Similar to meeting rooms II
62
62
"""
63
- max_end = min (
63
+ cur_max_end = min (
64
64
itv [E ]
65
65
for itvs in schedule
66
66
for itv in itvs
@@ -76,10 +76,10 @@ def employeeFreeTime(self, schedule: List[List[List[int]]]) -> List[List[int]]:
76
76
while q :
77
77
_ , i , j = heapq .heappop (q )
78
78
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 ]])
81
81
82
- max_end = max (max_end , itv [E ])
82
+ cur_max_end = max (cur_max_end , itv [E ])
83
83
84
84
# next
85
85
j += 1
@@ -122,7 +122,7 @@ def employeeFreeTime_error(self, schedule: List[List[List[int]]]) -> List[List[i
122
122
use index instead
123
123
"""
124
124
schedules = list (map (iter , schedule ))
125
- max_end = min (
125
+ cur_max_end = min (
126
126
itv [E ]
127
127
for emp in schedule
128
128
for itv in emp
@@ -136,9 +136,9 @@ def employeeFreeTime_error(self, schedule: List[List[List[int]]]) -> List[List[i
136
136
ret = []
137
137
while q :
138
138
_ , 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 ])
142
142
itv = next (emp_iter , None )
143
143
if itv :
144
144
heapq .heappush (q , (itv [S ], itv , emp_iter ))
0 commit comments