Blackhawk Network interview question

Programming maximum profit with multiple transactions