Company: Ibm_20nov
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[n]: the projects that the freelancers bid on int bid[n]: 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] Output: 21 Explanation: `projectId[i]` is aligned with `bid[i]` The first web developer bid 8 for project 2.