Maximum Profit with Limited Transactions - Coding problem | OneNoughtOne