Template Function ADS::maxProfit

Function Documentation

template<class T>
T ADS::maxProfit(const std::vector<T> &prices, std::size_t k)

the largest gain of at most k transactions on the prices

Post:

not negative