3476. Maximize Profit from Task Assignment
You are given an integer array
workers, whereworkers[i]represents the skill level of theithworker. You are also given a 2D integer arraytasks, where:
tasks[i][0]represents the skill requirement needed to complete the task.tasks[i][1]represents the profit earned from completing the task.Each worker can complete at most one task, and they can only take a task if their skill level is equal to the task’s skill requirement. An additional worker joins today who can take up any task, regardless of the skill requirement.
Return the maximum total profit that can be earned by optimally assigning the tasks to the workers.
1 | class Solution { |