I have been trying to solve this problem on leetcode (https://leetcode.com/problems/most-profit-assigning-work/) whose problem description goes like this :
We