How to solve this question using greedy algorithm link of question is given belo

give me the approach and also provide code and plzz reply fast

@ajayrajsingh_817 if the jobs were unwiegted, then it could be solved using greedy, but this version cannot be solved greedily!
so you have to consider every possibility and then optimize the solution using DP.
The article itself contains the DP approach.
If you still have any queries then feel free to ask but just go through it once!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.