classSolution:defmaxProfit(self, prices: List[int])->int:
result =0for i inrange(1,len(prices)):
result +=max((prices[i]- prices[i -1]),0)return result
🌷🍁 博主猫头虎(🐅🐾)带您 Go to New World✨🍁 🐅🐾猫头虎建议程序员必备技术栈一览表📖: 🛠️ 全栈技术 Full Stack: 📚…