Problem
A company is flying 2n people to interviews. costs[i] = [a, b] is the price of flying person i to city A or to city B. Exactly `n` people must go to each city. Return the minimum total cost.
Example 1
- Input
- costs = [[10, 20], [30, 200], [400, 50], [30, 20]]
- Output
- 110
- Why
- A, A, B, B
Example 2
- Input
- costs = [[20, 10], [10, 20]]
- Output
- 20
Constraints
2 * n == costs.length2 <= costs.length <= 100costs.length is even.1 <= a, b <= 1000