Zeta interview question

Find the max profit from array