Please tell the error in this
@Namanjain123
ur approach looks correct,
ur are getting tle error because u are using recursion to optimise it use dynamic programming
@Namanjain123
ur approach looks correct,
ur are getting tle error because u are using recursion to optimise it use dynamic programming