Given travel days and ticket costs for 1-day, 7-day, and 30-day passes, return the minimum cost needed to cover all travel days. This is a reusable-choice DP where each ticket choice can cover multiple future days.
days = travel days, costs = [1-day, 7-day, 30-day pass costs]
minimum total ticket cost
Example 1:
Input:
days = [1,4,6,7,8,20] costs = [2,7,15]
Output:
11
Explanation:
The cheapest plan costs 11.
Example 2:
Input:
days = [2] costs = [2,7,15]
Output:
2
Explanation:
A single 1-day pass is enough.