3
int twoCitySchedCost(vector<vector<int>> &costs) {4
sort(costs.begin(), costs.end(),5
[](const vector<int> &curr,6
const vector<int> &next) { // CUSTOM COMPARATOR7
return (curr[0] - curr[1]) <8
(next[0] - next[1]); // (comparing cost of sending to A - cost to B)10
// original: [[10,20],[30,200],[400,50],[30,20]]11
// after sort: [[30,200],[10,20],[30,20],[400,50]]15
for (int i = 0; i < costs.size() / 2; i++) {17
// cout<<costs[i][0]<<" "; // 30 1019
for (int i = costs.size() / 2; i < costs.size(); i++) {21
// cout<<costs[i][1]<<" "; // 20 50