Program i giveng tle for testcase 1 2

hello @Piyush-Pandey-2580479718941914
use dynamic programming to optimise ur logic.

recursive solution has exponential time complexity due to which it is giving tle.

apart from timecomplexity, logic is right,?

yeah … . . . . . . . . .