出自《Bitburner》原文:
You are given the following array of stock prices (which are numbers)
where the i-th element represents the stock price on day i:
116,68,128,7,49,20,139,65,74,18,121,70,96,178,185,28,179,123
Determine the maximum possible profit you can earn using as many transactions as you'd like.
A transaction is defined as buying and then selling one share of the stock.
Note that you cannot engage in multiple transactions at once.
In other words, you must sell the stock before you buy it again.
If no profit can be made, then the answer should be 0
You are given the following array of stock prices (which are numbers)
where the i-th element represents the stock price on day i:
116,68,128,7,49,20,139,65,74,18,121,70,96,178,185,28,179,123
Determine the maximum possible profit you can earn using as many transactions as you'd like.
A transaction is defined as buying and then selling one share of the stock.
Note that you cannot engage in multiple transactions at once.
In other words, you must sell the stock before you buy it again.
If no profit can be made, then the answer should be 0