Minimum Cost For Tickets
Medium · Dynamic Programming · about 20 minutes
Asked at Google, Amazon, Adobe, Microsoft, Autodesk.
You'll travel on the days in days (strictly increasing, within 1..365). Passes cost costs[0] for 1 day, costs[1] for 7 consecutive days and costs[2] for 30 consecutive days. Return the minimum cost to cover every travel day.