Statement
A recruiter plans to hire n people and conducts their interviews at two different locations of the company. He evaluates the cost of inviting candidates to both these locations. The plan is to invite 50% at one location, and the rest at the other location, keeping costs to a minimum.
We are given an array, costs
, where costs[i]=[aCosti​,bCosti​], the cost of inviting the ith person to City A is aCosti​, and the cost of inviting the same person to City B is bCosti​.
You need to determine the minimum cost to invite all the candidates for the interview such that exactly n/2 people are invited in each city.