time limit exceeded hacker rank – max profit if know future prices

I had an hacker rank challenge to find max profit given future stock prices in a array eg) given [1, 2, 3, 1] The code should buy a share at 1, at 2, and …I had an hacker rank challenge to find max profit given future stock prices in a array eg) given [1, 2, 3, 1] The code should buy a share at 1, at 2, and …Read More