Company: ibm_11oct
Difficulty: medium
Minimum Cost to Complete Projects Problem Description A client has posted several web development projects on a freelancing website, labeled from 0 to numProjects - 1 . Developers have placed bids on these projects: bid i offers to complete project projectId[i] for bid[i] . To complete a project, the client hires exactly one of the developers who bid on that project and pays that developer's bid. Every project must be completed. Return the minimum possible total cost of completing all projects. If some project has not received any bid, it cannot be completed; return -1 in that case. Function Description Complete the function minCost in the editor. It has the following parameters: int numProjects : the number of projects, labeled from 0 to numProjects - 1 int projectId[n] : projectId[i] is the project that bid i is for int bid[n] : bid[i] is the amount of bid i It returns a long : the minimum total cost of completing all projects, or -1 if any project has no bid. Input Format Read from