Practice Most Profit Assigning Work
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Job i has difficulty[i] and profit[i]. Worker j can complete a job only when its difficulty is at most worker[j]. Assign each worker at most one job; a job may be assigned to any number of workers, each earning its profit. A worker assigned no feasible job earns zero. Return the greatest total profit.
Source: Most Profit Assigning Work on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
difficulty = [2,4,6,8,10], profit = [10,20,30,40,50], worker = [4,5,6,7]
Output
100
# Example 2
Input
difficulty = [85,47,57], profit = [24,66,99], worker = [40,25,25]
Output
0
Constraints
n == difficulty.length
n == profit.length
m == worker.length
1 <= n, m <= 10^4
1 <= difficulty[i], profit[i], worker[i] <= 10^5
Related LeetCode Problems
Practice more problems similar to Most Profit Assigning Work.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.