You are given an array `prices` where `prices[i]` is the price of a stock on day `i`. Return the maximum profit from one buy and one sell. If no profit is possible, return 0.
Examples
Input
prices = [7,1,5,3,6,4]
Output
5
Buy day 1 (1), sell day 4 (6), profit = 5.
Input
prices = [7,6,4,3,1]
Output
0
Constraints
- 1 <= prices.length <= 10⁵
- 0 <= prices[i] <= 10⁴