We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 253ed67 commit 8f0f74bCopy full SHA for 8f0f74b
1834.single_threaded_cpu/cpu.py
@@ -67,11 +67,11 @@ def getOrder(self, tasks: List[List[int]]) -> List[int]:
67
while sorted_tasks or min_heap:
68
while sorted_tasks and sorted_tasks[-1].enqueue <= cur_time:
69
heapq.heappush(min_heap, sorted_tasks.pop())
70
- if len(min_heap) < 1:
+ if not min_heap:
71
cur_time = sorted_tasks[-1].enqueue
72
else:
73
task = heapq.heappop(min_heap)
74
- cur_time = cur_time+task.processing
+ cur_time = cur_time + task.processing
75
processed.append(task.index)
76
77
return processed
0 commit comments