https://practice.geeksforgeeks.org/problems/maximum-profit4657/1