1. 首页
  2. 数据库
  3. 其它
  4. 买卖股票最佳时机1 4加注释

买卖股票最佳时机1 4加注释

上传者: 2021-01-08 11:44:34上传 PDF文件 44.02KB 热度 22次
1: 主要思想:dp(最大和子数组) class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype: int """ lenth = len(prices) if lenth == 1 or lenth == 0: return 0 newlst = [] for i in range(1,lenth):
下载地址
用户评论