这是悦乐书的第173次更新,第175篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第32题(顺位题号是122).假设有一个数组,其中第i个元素是第i天给定股票的价格.设计算法以找到最大利润.可以根据需要完成尽可能多的交易(即,多次买入并卖出一股股票). 注意:不能同时进行多笔交易(即,您必须在再次购买之前卖出股票). 例如: 输入:[7,1,5,3,6,4] 输出:7 说明:在第2天买入(价格= 1)并在第3天卖出(价格= 5),利润= 5-1 = 4.然后在第4天…