Company: Amazon_16oct
Difficulty: medium
Calculate Optimal Bandwidth Problem Description Amazon's Network Infrastructure Division wants to push as much traffic as possible through its data centers. There are n data centers, and the bandwidth capacity of center i is capacity[i] . connectionCount data streams have to be routed. Every stream is assigned two data centers: a primary center and a failover center. The bandwidthRate of a stream is the capacity of its primary center plus the capacity of its failover center. No two streams may use the same route. A route is an ordered pair (x, y) meaning primary x , failover y , so: (x, y) and (y, x) are two different routes, and both may be used. The same center may be both primary and failover: (x, x) is a valid route. That gives n * n distinct routes in total. Choose a different route for each of the connectionCount streams so that the total bandwidthRate over all streams is as large as possible, and return that maximum total. Function Description Complete the function calculateOpti