Company: citadel_3aug
Difficulty: medium
Minimum Processing Cost Problem Description Devise a strategy to minimize the costs of processing n images, where each image requires specific filters applied for a defined time frame. The cost to apply the filter for the i-th image is filterCost[i] . Each image must be processed every day from startDay[i] to endDay[i] (inclusive). Additionally, there is an exclusive offer to apply all in-scope filters for a given day at a discounted rate of discountPrice . For any given day, you can either pay the sum of the costs for all filters active on that day, or you can pay the flat discountPrice , whichever is less. Your goal is to create an efficient image processing plan that adheres to time constraints and budget considerations, and return the minimum total cost modulo (10 9 + 7). Examples Example 1: Input: n = 3, filterCost = [2, 3, 4], startDay = [1, 1, 2], endDay = [2, 3, 4], discountPrice = 6 Output: 21 Explanation: We calculate the minimum cost for each day: Day 1: Images 1 (cost 2) an