Bessie's Interview
My Algorithm
- keep a queue with all of the upcoming interviews, sorted in increasing order of how long before it ends. Delete the interviews from the input array as they get processed into the queue
- jump up the minutes by the first position in the queue and subtract everything else in the queue by that
- if multiple elements in the queue are now the same, they can be combined into one (but you need some way of also denoting how many farmers each number represents)
- for the first element, choose the minimum of the next F numbers (where F is the number of farmers this number represents). Delete the first element from the queue and add that minimum to the queue. Delete those interviews from the input arrayLast updated