Simple Solution based on Sorting
Intuition\nFind worker most difficult job as per there capacity.\n\n# Approach\nSort and assign job as per capacity.\n\n# Complexity\n- Time complexity:\nSortin
# Intuition\nFind worker most difficult job as per there capacity.\n\n# Approach\nSort and assign job as per capacity.\n\n# Complexity\n- Time complexity:\nSorting O(nlogn)\n\n- Space complexity:\nO(1)\n\n# Code\n```\npublic class Solution {\n    public int MaxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {\n    \n        Array.Sort(difficulty, profit);\n        Array.Sort(worker);\n\n        int netProfit = 0;\n        int maxProfit = 0;\n        int k = 0;\n\n        foreach (int w in worker) {\n            while (k < difficulty.Length && w >= difficulty[k]) {\n                maxProfit = Math.Max(maxProfit, profit[k]);\n                k++;\n            }\n            netProfit += maxProfit;\n        }\n\n        return netProfit;\n    }\n}\n\n```
['C#']