Pergunta de entrevista da empresa Toast Inc

In the first technical round, I was asked a LeetCode-style problem: “Given an array representing stock prices on each day, find the best time to buy and sell to maximize profit.”