Zeta Interview Question

Find the max profit from array