Company: ibm_29sep
Difficulty: medium
Minimum Project Cost Problem Description A client has posted multiple web development projects on a freelancing website, and different developers have submitted bids for these projects. Given the information about project bids, determine the minimum total cost for the client to complete all projects. Return the minimum possible cost for completing all projects. If any project does not receive any bids, return -1. Complete the function minCost in the editor with the following parameters: int numProjects : the total number of projects labeled from 0 to numProjects - 1 . int projectId[] : the projects that the freelancers bid on. int bid[] : the bid amounts posted by the freelancers. Returns: long : the minimum cost the client can spend to complete all projects, or -1 if any project has no bids. Examples Example 1: Input: numProjects = 3 projectId = [2, 0, 1, 2] bid = [8, 7, 6, 9] Explanation: The bids are aligned with projectId as follows: The first web developer bid 8 for project 2. The