Best Time to Buy and Sell Stock
EasyGiven daily stock prices, choose one day to buy and a later day to sell. Print the maximum possible profit. If no profitable trade exists, print 0.
Input format:
- First line: n
- Second line: n prices
Constraints
1 <= n <= 10^5 0 <= prices[i] <= 10^9