Max Profit is a Codility exercise where an array of stock prices is given. Each value in the array represents the stock price on a particular day. The aim is to find the maximum possible profit that could have been made by trading the stock during the time represented by the array of prices.
This video shows my Java solution. I realise in the edit that there's a bit of unnecessary code in there. This is marked in the video. It works all the same and scores 100%.