for n greater than 5 i am getting tle. please help, how can i reduce the execution time. here is the link to code
Tle error occuring
You don’t have to do so much of work. Just a single recursive function would do.
Check out my code below and tell me if you are able to understand it.