28/40
Part 5 of 7 · The answer and a limitLearn and do
A limit of k multiplies the work by k + 1, and k never needs to pass E
The table has cells for junctions and a limit of . Every stretch is tried once per count. So the cost is time and memory.
A route can't ride more expert stretches than the park has, so never needs to pass , and this stays polynomial. A budget is different. One row per minute or per dollar is the coin-change lesson's pseudo-polynomial warning: a budget of a billion minutes is a table of a billion rows per junction.
In the editor, fill the inner loop of best_limited(below, order, start, exits, limit). It prints the best total for limits of 0, 1 and 2.