This question was asking in a OA for a L4/L5 position with Amazon.
Any ideas as to the implementation of this code? I understand that we could probably start off with a time-tracking variable initialized to 0. We can add all of the elements from the wait list into a Queue, or in Python we can just work with the stack itself. As each iteration passes, we either serve a new object in the queue, process it, or remove it from the queue if the waitTime of the object in the Queue is equal to or greater than the t or time_tracking value.
Thanks.
