Maximum Performance of a Team

Hard · Heap & Priority Queue · about 30 minutes

Asked at Amazon, Google, Microsoft.

There are n engineers with speed[i] and efficiency[i]. Choose at most k of them to maximize performance = (sum of speeds) × (minimum efficiency). Return the maximum modulo 10⁹ + 7 (maximize first, then take the modulo).

Related guides