Company: IBM___.
Difficulty: medium
Minimum Cost for Projects 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. Example Suppose numProjects = 3 , projectId = [2, 0, 1, 2] , and bid = [8, 7, 6, 9] . Output: 21 Explanation: Each projectId[i] is aligned with bid[i] . This means: A bid of 8 is for project 2. A bid of 7 is for project 0. A bid of 6 is for project 1. A bid of 9 is for project 2. To find the minimum cost for each project, we take the lowest bid for each: There is only one bid for project 0: it costs 7. There is only one bid for project 1: it costs 6. There are two bids for project 2: 8 and 9. The lower bid is 8. The lowest total cost for the three projects is the sum of t