Java ,Memorization without sort,Beat 99.85%
\nclass Solution {\n    public int maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {\n        int[] dp = new int[100001];\n        for (int i 
```\nclass Solution {\n    public int maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {\n        int[] dp = new int[100001];\n        for (int i = 0; i < difficulty.length; i++) {\n            dp[difficulty[i]] = Math.max(dp[difficulty[i]], profit[i]);\n        }\n        for (int i = 0; i < dp.length; i++) {\n            if (i > 0) {\n                dp[i] = Math.max(dp[i - 1], dp[i]);\n            }\n        }\n        int sum = 0;\n        for (int i : worker) {\n            sum += dp[i];\n        }\n        return sum;\n    }\n}\n```
[]