Welcome to the Python screen.
The question is on your right: Maximize Profit from Stock Prices. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
Given an array of integers prices where prices[i] is the price of a given stock on the i-th day, return the maximum profit you can achieve from this transaction. You may complete at most one transaction (i.e., buy one and sell one share of the stock). If you cannot achieve any profit, return 0.
def max_profit(prices: list[int]) -> int: