Create a method to find the maximum profit from stock prices where you can only buy and sell once.
MediumProblem Statement
Create a method to find the maximum profit from stock prices where you can only buy and sell once.
Sample Input
[7, 1, 5, 3, 6, 4]
Sample Output
5
Limits
Time: 2s · Memory: 256 MB