Template Function ADS::refuelingStops

Function Documentation

template<class T>
std::optional<std::vector<std::size_t>> ADS::refuelingStops(const std::vector<T> &D, T L, T R)

refuelingStops(): the places in D of the fewest stops of a trip from 0 to L, a full tank lasting R and the stations at D, nothing if the trip cannot be made

Pre:

D sorted in [ 0 , L ], L >= 0, R >= 0

Post:

the stops increase, and no leg is longer than R (audit)