Function ADS::optimalChange

Function Documentation

inline std::optional<long> ADS::optimalChange(const std::vector<long> &coins, long c)

the fewest coins that pay c, nothing if none

Pre:

c >= 0 and the coins positive