#Array #Min #Max
Loop over the Array and record the min element before the i-th place and based on that to calculate the max profit to solve this LeetCode Best Time to Buy and Sell Stock problem.
Please subscribe, like and comment to let us learn from each other!
BGM: https://www.bensound.com