买卖股票最佳时机1 4加注释
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):
下载地址
用户评论