i am following recursion but getting tle on few cases is the logic wrong or am i supposed to follow dp?
Getting tle in few test cases
yes, dp!!
as many of your fellows have same problem!!
do it after dp
also,
you should take modulo within the recursion i.e.
βreturn (horizontal + vertical)%1000000007;β
alright thank you so much
1 Like