code:
Custom testcase running but no output on submitting
Hello @myself.yash.srivastav,
-
the return type of your function is wrong:
Solution:
// return (way1+way2);
return (way1+way2)%1000000007; -
Your code is logically correct but causing TLE for test cases like:
2
67309 8625
86402 1354
Solutions:
-
Base case:
if(n>=0 && n<m){
return n;}else if(n<0){
return 0;
} -
Apply Dynamic Programming to solve this as it is causing redundant iterations.
Hope, this would help.
Give a like if you are satisfied.
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.