JS solution beats 100% with 156 ms where existing solution takes at least 1088ms
js\n/**\n * @param {number[]} difficulty\n * @param {number[]} profit\n * @param {number[]} worker\n * @return {number}\n */\nvar maxProfitAssignment = function
```js\n/**\n * @param {number[]} difficulty\n * @param {number[]} profit\n * @param {number[]} worker\n * @return {number}\n */\nvar maxProfitAssignment = function(difficulty, profit, worker) {\n    const meta = profit.map((p, i) => ({ profit: p, difficulty: difficulty[i] })).sort((m1, m2) => m2.profit - m1.profit);\n    const sortedWorker = worker.slice().sort((a, b) => b - a);\n    let result = 0;\n    let j = 0;\n    for (let i = 0; i < meta.length; i++) {\n        while (sortedWorker[j] >= meta[i].difficulty) {\n            result += meta[i].profit;\n            j++;\n        }\n    }\n    return result;\n};\n```
[]