Fewest days to deliver every order from distribution centers
There are N distribution centers numbered 1..N and a list of orders, each naming a destination city numbered like the centers. Each day a center can work on one order: delivering to its own city takes one day, delivering to any other city takes two. Return the fewest days needed to deliver all orders. For N = 3 and orders [1, 1, 3, 1, 1] the answer is 3.
No answer yet. Write the first one; the best answer gets endorsed.
