Minimum candidate flight cost

Write codeMedium20 min

Your task

A company is interviewing 2n candidates. Flying candidate i to city A costs costs[i][0] and to city B costs costs[i][1]. Exactly n people must go to each city. Return the minimum total cost to fly everyone such that the cities are evenly split. The input has an even length up to 200; all costs are non-negative integers.

Examples

two_city_cost(costs: list[list[int]]) -> int
Example 1
Inputtwo_city_cost([[10, 20], [30, 200], [400, 50], [30, 20]])
Output110