3
static bool cmp(pair<int, int> a, pair<int, int> b) {4
if (a.first == b.first) {5
return a.second < b.second;8
return a.first > b.first;10
int maxProfitAssignment(vector<int> &difficulty, vector<int> &profit, vector<int> &worker) {12
vector<pair<int, int>> vp;13
for (int i = 0; i < profit.size(); i++) {14
vp.push_back({profit[i], difficulty[i]});16
sort(vp.begin(), vp.end(), cmp);17
sort(worker.begin(), worker.end(), greater<int>());19
// i is for traversing the vp and j is for traversing the worker22
while (i < vp.size() and j < worker.size()) {23
if (worker[j] >= vp[i].second) {