Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
752 views
in Online Assessments by Expert (108,190 points) | 752 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
    where:

 

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.

 

Example:
input: jobs=[2,4,6,8,10], payment=[10,20,30,40,50], manpower=[4,5,6,7]
output:100
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]
output:0.

 

does any one know soultion for this question.

 

other 2 question similar to below,
2) https://leetcode.com/problems/stickers-to-spell-word/
3) https://leetcode.com/problems/friends-of-appropriate-ages/

by Expert (108,190 points)
0 like 0 dislike
this can be solved using binary search+computing the maximum payment till particular strength
by Expert (108,190 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 .