Back to problems

Minimum Cost Flight Split

Algorithm · Bloomberg · Medium

Requirements You are given n candidates, where n is even for the base version. Candidate i has two possible travel costs: costSF[i] — the expense of sending candidate i to San Francisco. costNY[i] — the expense of sending candidate i to New York. Place exactly n / 2 candidates in San Francisco and the other n / 2 in New York while minimizing the combined cost. Return that minimum cost. Function signature: Follow-ups: How would the problem change if exactly k candidates had…

Checking your access…