Function ADS::greedyChange

Function Documentation

inline std::optional<std::vector<long>> ADS::greedyChange(std::vector<long> coins, long c)

the coins taken by the greedy choice, the coins in any order; nothing if it cannot pay

Pre:

c >= 0 and the coins positive

Post:

the change sums to c