Doubt in Job for Bounties II.[dp]

so i coded recursive solution ans got ac.
lilnk: https://ide.codingblocks.com/s/259441

but after that for confirmation i unlocked editorial and i see that hear it uses dp to solve problem and i don’t think there is overlapping subproblems or if there is please explain me.

Yes it can be done with DP!, just think of it as a variant of knapsack problem.
the states will be time and index of job.
Actually it must be done with DP only! your solution passed because of weak tests.

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.