Daily challenge for 2026-07-20
566. Minimum Paint Cost
You are given a list of integers costs representing the cost to paint each house in a row. You want to paint all the houses, but you have a special discount: for every two houses you paint, the cheaper one is free. If there is an odd number of houses, the last one is not discounted. Return the minimum total cost to paint all houses if you can pair them up optimally. To do this greedily, pair the most expensive houses together.
Example:Input: costs = [4, 2, 8, 5]Output: 12
Explanation: Pair 8 and 5 (cost 8), pair 4 and 2 (cost 4). Total = 12.
Run this challenge interactively in Python or JavaScript when the app loads.