Best Time to Buy and Sell Stock

Greedy ยท easy

Implement `maxProfit(prices)` returning the maximum profit from one buy followed by one later sell, or `0` if no profit is possible.

Learning resources

Loading...

Run your code to see results.