You are viewing a single comment's thread. Return to all comments →
something like this: def get_next_valid_order(t, q): restoreitems = [] pizza_cook_time, start_time = q.next() while start_time > t: restoreitems.append((pizza_cook_time, start_time)) pizza_cook_time, start_time = q.next() if restoreitems: for item in restoreitems: q.push(item[0], item[1]) return pizza_cook_time, start_time
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Average Waiting Time
You are viewing a single comment's thread. Return to all comments →
something like this: def get_next_valid_order(t, q): restoreitems = [] pizza_cook_time, start_time = q.next() while start_time > t: restoreitems.append((pizza_cook_time, start_time)) pizza_cook_time, start_time = q.next() if restoreitems: for item in restoreitems: q.push(item[0], item[1]) return pizza_cook_time, start_time