Just sorting, two pointer, and Heap
\nd=difficulty.size();\nn=worker.size();\n# Complexity\n- Time complexity:O(dlog(d)+nlog(n))\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O
\nd=difficulty.size();\nn=worker.size();\n# Complexity\n- Time complexity:O(dlog(d)+nlog(n))\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(d)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) {\n        \n        vector<vector<int>> v;\n\n        int n=difficulty.size();\n\n        for(int i=0;i<n;i++){\n            v.push_back({difficulty[i],profit[i]});\n        }\n        sort(v.begin(),v.end());\n        sort(worker.begin(),worker.end());\n\n        priority_queue<int> pq;\n\n        int i=0;\n        int ans=0;\n        for(auto w:worker){\n            while(i<n&&v[i][0]<=w){\n                pq.push(v[i][1]);\n                i++;\n            }\n\n            if(!pq.empty())\n            ans+=pq.top();\n\n\n        }\n\n        return ans;\n\n\n    }\n};\n```
['Two Pointers', 'Greedy', 'Sorting', 'Heap (Priority Queue)', 'C++']