Ezvor

3476. Maximize Profit from Task Assignment

MediumArray Preparing judge… LeetCode
ArrayGreedySortingHeap (Priority Queue)

Hints

Hint 1
Use a hashmap to group the tasks by their required skill level tasks[i][0]
Hint 2
For each worker, assign the highest profit task from the hashmap that matches their exact skill requirement
Hint 3
Assign the task with the maximum profit among the unassigned tasks to the extra worker