For Rust Geeks
Complexity\n- Time complexity: O(nlog(n) + mlog(m))\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(m + n)\n Add your space complexity here
# Complexity\n- Time complexity: $$O(nlog(n) + mlog(m))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(m + n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimpl Solution {\n    pub fn max_profit_assignment(difficulty: Vec<i32>, profit: Vec<i32>, mut worker: Vec<i32>) -> i32 {\n        let (n, m) = (profit.len(), worker.len());\n        worker.sort_unstable();\n\n        let mut pos = (0..n).collect::<Vec<usize>>();\n        pos.sort_unstable_by(|&a, &b| difficulty[a].cmp(&difficulty[b]));\n\n        let (mut i, mut j) = (0, 0);\n        let mut ans = 0;\n        let mut max = 0;\n\n        while j < m {\n            while i < n && difficulty[pos[i]] <= worker[j] {\n                max = i32::max(max, profit[pos[i]]);\n                i += 1;\n            }\n\n            ans += max;\n            j += 1;\n        }\n\n        ans   \n    }\n}\n```
['Rust']