def maxProfit(prices):
    min_price = prices[0]
    max_profit = -float('inf')
    for i in range(1, len(prices)):
        if prices[i] < min_price:
            min_price = prices[i]
        else:
            max_profit = max(max_profit, (prices[i] - min_price))
    return max_profit




prices = [10, 7, 5, 8, 11, 9]
print(maxProfit(prices))
8fdc059728bf11a0a45e80ea46aadfa0c97a8e8e
<mask token>

def maxProfit(prices):
    min_price = prices[0]
    max_profit = -float('inf')
    for i in range(1, len(prices)):
        if prices[i] < min_price:
            min_price = prices[i]
        else:
            max_profit = max(max_profit, prices[i] - min_price)
    return max_profit


<mask token>

def maxProfit(prices):
    min_price = prices[0]
    max_profit = -float('inf')
    for i in range(1, len(prices)):
        if prices[i] < min_price:
            min_price = prices[i]
        else:
            max_profit = max(max_profit, prices[i] - min_price)
    return max_profit


<mask token>
print(maxProfit(prices))

def maxProfit(prices):
    min_price = prices[0]
    max_profit = -float('inf')
    for i in range(1, len(prices)):
        if prices[i] < min_price:
            min_price = prices[i]
        else:
            max_profit = max(max_profit, prices[i] - min_price)
    return max_profit


prices = [10, 7, 5, 8, 11, 9]
print(maxProfit(prices))

def maxProfit(prices):
    min_price = prices[0]
    max_profit = -float('inf')
    for i in range(1, len(prices)):
        if prices[i] < min_price:
            min_price = prices[i]
        else:
            max_profit = max(max_profit, (prices[i] - min_price))
    return max_profit




prices = [10, 7, 5, 8, 11, 9]
print(maxProfit(prices))