https://practice.geeksforgeeks.org/problems/minimum-sum4058/1