Maximize Trading Gains - Coding problem | OneNoughtOne