Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
in Online Assessments by Expert (111,530 points) | 706 views

2 Answers

0 like 0 dislike
Best answer
  1. You have 'x' jobs and 'y manpower(workers). you are given three array; jobs, payment and manpower


jobs[m] and payment[m] are the difficulty and the payment for the mth job and
manpower[n] is the capacity of nth worker(i.e nth worker can only complete a job with diffculty atmost manpower[n])
Every manpower can be assigned at most one job, but one job can be completed multiple times.


for example, if three manpower attempt the same jobs that pays $2 then total profit will be $6. if manpower cannot complete any jobs, their profit is $0.


Return the maximum payment we can achieve after assigning manpower to the jobs.


input: jobs=[2,4,6,8,10], payment=[10,20,30,40,50], manpower=[4,5,6,7]
explantion: Manpowers are assinged jobs of difficulty [4,4,6,6] and they get payment of [20,20,30,30] separately.


example 2:
input: jobs=[85,47,57], payment=[24,66,99], manpower=[40,25,25]


does any one know soultion for this question.


other 2 question similar to below,

by Expert (111,530 points)
0 like 0 dislike
this can be solved using binary search+computing the maximum payment till particular strength
by Expert (111,530 points)

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .