Blackhawk Network Interview Question

Programming maximum profit with multiple transactions