122、Best Time to Buy and Sell Stock II

Say you have an array for which theithelement is the price of a given stock on dayi.

Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). However, you may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).

Hide Tags

ArrayGreedy

题意:给定一支股票的价格表,先买后卖,,可以有多次交易,求最大收益

与其在那里苦苦挣扎,碍于面子硬撑,倒不如微笑着面对,

122、Best Time to Buy and Sell Stock II

相关文章:

你感兴趣的文章:

标签云: