Company: Msci_28july
Difficulty: medium
Minimum Cost to Rent Cores Problem Description In order to shift its infrastructure to the cloud, a company plans to rent k computing cores per day over n days. They have m pricing plans available for this period. Each pricing plan includes: l[i] and r[i] : the starting and ending days the plan is available c[i] : the number of cores available each day p[i] : the cost to rent one core per day The company can rent between 0 and c[i] cores each day from each available plan. Given n , k , and the list of plans as a 2D array, return the minimum cost to rent the required cores. Function Description Complete the function getMinCost in the editor with the following parameter(s): int n : the number of days to rent cores int k : the number of cores to rent each day int plans[m][4] : each plan[i] contains [l[i], r[i], c[i], p[i]] , the start and end days, cores available, and price per core per day Returns: long : the minimum cost to complete the process Examples Example 1: Suppose n = 5 , k = 7