You are given n jobs and m workers, represented by three arrays: difficulty, profit, and worker.
difficulty[i] and profit[i] represent the difficulty level and profit of the i-th job.
worker[j] represents the maximum difficulty level the j-th worker can handle.
A worker can complete a job only if the job’s difficulty is less than or equal to that worker’s ability. Each worker can be assigned at most one job, but multiple workers can complete the same job.
If a worker cannot complete any job, they contribute
Return the maximum total profit achievable by assigning jobs to workers optimally.
Constraints:
n == difficulty.length
n == profit.length
m == worker.length
n, m
difficulty[i], profit[i], worker[i]
You are given n jobs and m workers, represented by three arrays: difficulty, profit, and worker.
difficulty[i] and profit[i] represent the difficulty level and profit of the i-th job.
worker[j] represents the maximum difficulty level the j-th worker can handle.
A worker can complete a job only if the job’s difficulty is less than or equal to that worker’s ability. Each worker can be assigned at most one job, but multiple workers can complete the same job.
If a worker cannot complete any job, they contribute
Return the maximum total profit achievable by assigning jobs to workers optimally.
Constraints:
n == difficulty.length
n == profit.length
m == worker.length
n, m
difficulty[i], profit[i], worker[i]