Min Cost to Complete All Projects

Salesforce coding interview problem: Given numProjects and arrays projectId and bid representing freelancers’ offers per project, find the minimum total cost to complete all projects. Return -1 if any project has no bids. This interview question appears in Salesforce interviews and focuses on project coverage and cost.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: