Refer for code: -
3 Testcases Failing
hello @ambuj_0909
your recurrence relation is not correct.
it should be
Find_ways(n,m)=Find_ways(n-1,m)+Find_ways(n-m,m)
base case->
n<m return 1
n==m return 2
yeah it will not because recursive solution has high time complexity.
apply dynamic programming to pass all test cases.
@aman212yadav
Applied DP approach but still getting Wrong answer for all those testcases.
Refer for code:-
take mod as well(refer output format)
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.