I tried to do this exercise where the idea is, from an array of stock values, buy at the lower value and sell at the higher value.
Example: Input: [7,1,5,3,6,4] Outpu