开个坑,每天两道简单算法题
8-22
121. 买卖股票的最佳时机
p=0
b=[0]
for i in range(len(prices)):
if i + 1 < len(prices):
p=max(prices[i+1:])-prices[i]
b.append(p)
return max(b)
8-23
1.两数之和