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.