Billboard revenue
Your task
A highway agency sells billboard slots along a road, listed in order with the expected revenue for each (all positive). Local rules say two rented billboards must have at least two empty slots between them, so if you take slot i, the next one you take must be at index i+3 or later. Given the revenues, return the maximum total you can earn. An empty list returns 0. For example, [8, 3, 2, 9] gives 17 by taking slots 0 and 3.
Examples
max_billboard_revenue(revenues: list[int]) -> intExample 1
Input
max_billboard_revenue([8, 3, 2, 9])Output
17Example 2
Input
max_billboard_revenue([10, 1, 1, 1, 10])Output
20