What is the stock profit problem asking for?
Practice this question from Best Time to Buy and Sell Stock - Greedy Pattern Practice Quiz, with options and an explanation.
Question
What is the stock profit problem asking for?
Option A
Maximum sum of any subarray
Option B — Correct answer
Maximum profit from one buy before one sell
Option C
Number of profitable days
Option D
Minimum price only
Explanation
You need the best profit from one buy day and one later sell day.