def get_min_processing_cost(n: int, filter_cost: list[int], start_day: list[int],
end_day: list[int], discount_price: int) -> int:Reported by a Citadel Software Engineer intern (US) candidate as the second of two problems in a 75-minute round.
Input: an integer n, integer arrays filterCost, startDay and endDay (each of length n), and an integer discountPrice.
You need to process n images. Processing image i costs filterCost[i] per day, and image i must be processed on every day from startDay[i] to endDay[i].
Every day you may use the discount once. If you use it, processing all the images that day costs discountPrice.
Return the minimum cost to process all n images, modulo 10^9 + 7.
Example
n = 3
filterCost = [2, 3, 4]
startDay = [1, 1, 2]
endDay = [2, 3, 4]
discountPrice = 6
Day Images Total cost
1 [1, 2] 2 + 3 = 5
2 [1, 2, 3] 2 + 3 + 4 = 9
3 [2, 3] 3 + 4 = 7
4 [3] 4
Use the discount on day 2 and day 3 => 5 + 6 + 6 + 4 = 21
Notes and things to confirm
endDay is inclusive (image 3 runs from day 2 to day 4 and is paid on day 4), and a discounted day costs discountPrice in total, not per image (day 2 has three images and costs 6).n, the costs, discountPrice or the day numbers. Ask for them: they decide whether you can afford to visit every day.One report, posted in July 2025 by a Citadel Software Engineer intern (US) candidate: two problems in 75 minutes. The report does not name the format; two formal prompts with an example and a time limit read like an online assessment. This was the second; the first asked for the fewest changes that make a password a palindrome that repeats with period k. The candidate wrote that the problems did not feel hard but that they solved neither, and shared the prompts for others.
The prompt lists the inputs as n, filterCost, startDay, endDay and discountPrice and asks for the minimum cost modulo 10^9 + 7, with the example above. It gives constraints for the first problem only; for this one, no bounds on n, the costs or the day numbers. A reply later posted a solution that adds each image's cost to every day it covers and pays the smaller of each day's total and the discount, written in JavaScript.
Reported by a Citadel Software Engineer intern (US) candidate as the second of two problems in a 75-minute round.
Input: an integer n, integer arrays filterCost, startDay and endDay (each of length n), and an integer discountPrice.
You need to process n images. Processing image i costs filterCost[i] per day, and image i must be processed on every day from startDay[i] to endDay[i].
Every day you may use the discount once. If you use it, processing all the images that day costs discountPrice.
Return the minimum cost to process all n images, modulo 10^9 + 7.
Example
n = 3
filterCost = [2, 3, 4]
startDay = [1, 1, 2]
endDay = [2, 3, 4]
discountPrice = 6
Day Images Total cost
1 [1, 2] 2 + 3 = 5
2 [1, 2, 3] 2 + 3 + 4 = 9
3 [2, 3] 3 + 4 = 7
4 [3] 4
Use the discount on day 2 and day 3 => 5 + 6 + 6 + 4 = 21
Notes and things to confirm
endDay is inclusive (image 3 runs from day 2 to day 4 and is paid on day 4), and a discounted day costs discountPrice in total, not per image (day 2 has three images and costs 6).n, the costs, discountPrice or the day numbers. Ask for them: they decide whether you can afford to visit every day.| Approach | Notes |
|---|---|
| Per-day totals array | Posted in a reply: add each image's cost to every day it covers, then pay min(day total, discountPrice) per day. O(n * D) time and O(D) space for D days; simple, but depends on the day numbers being small, which the report does not state. |
Why people fail: The candidate solved neither of the two problems within the 75 minutes, although they felt the problems were not hard.
Send them this page. It is free to read, no account needed.
What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 62 Citadel questions, refreshed monthly from new candidate reports.