Minimum toll checkpoint cost

Write codeEasy10 min

Your task

A toll road on your trip has checkpoints in order, with a fee listed for each. You start standing on the first checkpoint (and pay its fee), and you must finish standing on the last one. From any checkpoint you may drive ahead to the next checkpoint or skip one and land two ahead; you pay the fee of every checkpoint you land on. Given the fees, return the minimum total you must pay. The list has at least one checkpoint.

Examples

min_toll_cost(fees: list[int]) -> int
Example 1
Inputmin_toll_cost([1, 100, 1, 1, 100, 1])
Output4
Example 2
Inputmin_toll_cost([10, 1, 10, 1, 10])
Output22