i am generating all possible numbers without consecutive ones.
Code- https://ide.codingblocks.com/s/149018
Unable to pass Test Cases
Use long long int since your answer may overflow.
Sir thats ok… but for n >30 or 40… tle is coming… how can i do it using recursion only but with different approach so to avoid tle
Apologies for a delayed response. Recursive approach is fine. Why don’t you think of memorizing. Apply top down DP to avoid TLE.
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.