You are given an array prices where prices[i] represents the price of a stock on the i-th day.
Your goal is to find the maximum profit you can achieve by choosing one day to buy the stock and a different day in the future to sell it.
If no profit can be made (i.e., prices keep decreasing), return 0.
Input: prices = [8, 3, 6, 1, 9, 5]
Output: 8
Input: prices = [10, 9, 8, 7, 6]
Output: 0
Accepted:
Submission: