I hope samajh raha hoga! kuch bhi suggestions ho to bata sakte ho Also TLE isliye aa raha hai because ye sab problems Dynamic Programming (DP) ki hai vo jab karnege to hatt jayega ye don’t worry! link: practice.geeksforgeeks.org/problems/count-ways-to-reach-the-nth-stair-1587115620/1
jab mene yhan submit kiya to mera code 21th test case par jakar code optimazation ke liye bol rha hai so what i do my code is : int countWays(int n) { if(n==2 || n==1)return n; long long int recall1 = countWays(n-1); long long int recall2 = countWays(n-2); long long int res = recall1+recall2; return res; }
Same as previous question it's showing the time limit exceeded error and it only passed 21 cases over 997. I know this is the way to get answer but i think it's not so optimized. Edited - Ok I saw your pinned comment now i got this. 👍
Thanks nishant bro it is very helpful to revise my recursion and also easy to understand thanx for this and itta hardwork krne k liye humare liye..... your hardwork payss off.....
Recursion is crystal clearly explained by you nishanth brother.... Thank you so much for having a little glimpse of last 2 classes in today's class bcz it made us to take to the concept so much brother.... Thanks a lot and the trick of base case, small calculation, recursive call and it is very clear brother.... Day 3/Day 30 is successfully completed bro Excited for tomorrow's session brother
Jo log apne copy 📚 pe ye sb study karke notes bana rahe h like my comments ok 💗 thanks a lot bhiya love this code in 10 Regular rahna hai tabhi maza aayga ❤️❤️❤️
I am waiting for my 12 board result, then I go to my college but, before I know the Recursion topic, Thanks Nishat bhaiya for the day 3 out of 30 days And and and....... I am coming..........................!