Question
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.
min_toll_cost(fees: list[int]) → int[[1,100,1,1,100,1]]out4[[10,1,10,1,10]]out22State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.