Back to problems

Min Cost to Complete All Projects

Algorithm · Salesforce · Easy

A client needs to hire freelancers for numProjects distinct projects, labeled 0 through numProjects - 1. A list of bids has been submitted: for each bid i, projectId[i] identifies the project and bid[i] gives the quoted price. You must determine the minimum total amount the client must pay so that every project is assigned to exactly one freelancer. If at least one project receives no bids, return -1 since it is impossible to cover all projects. Implement the function…

Checking your access…