Company: Amazon_23july
Difficulty: medium
Processor Power Matching Problem Description Amazon Web Services (AWS) has millions of servers that provide on-demand cloud computing platforms to their clients. In one AWS center, there are n processes to be executed and m processors to execute them. The i th process requires power[i] for execution. A processor can provide power within its range minPower through maxPower . Process i can be executed on processor j if minPower[j] ≤ power[i] ≤ maxPower[j] . Given the power consumption of n processes and the range of power consumption of m processors, for each processor, find: the number of processes which can be executed on the processor the sum of power consumed by the processes that it can serve Note: The processes are run one at a time, hence the range of the processor is the same for each process individually. In other words, if two processes i and j can be executed on a processor p , then minPower[p] ≤ power[i] ≤ maxPower[p] and minPower[p] ≤ power[j] ≤ maxPower[p]