class Solution:
def maxProfit(self, prices):
cur_profit = 0
cur_low = prices[0]
# 시간이 뒤로만 가니까 앞에서부터 한 번만 보면됨
for price in prices:
# 지금이 고점이면 수익 갱신해줌.
if price - cur_low > cur_profit:
cur_profit = price - cur_low
# 저점 갱신
if cur_low > price:
cur_low = price
return cur_profit