Thank you for this video! I am still learning about time complexity and I was wondering how your solutions differ from what I came up with => const steps = (n) => { if(n === 0 || n === 1) return 1; return stairs(n-2) + stairs(n-1); }
The way he codes it it would throw a runtime time error since right after dp[1] = 1 you say dp[2] = 2. Index 2 is outside of the bounds of the array (size is 2, last index is 1)
Thank you for this video! I am still learning about time complexity and I was wondering how your solutions differ from what I came up with =>
const steps = (n) => {
if(n === 0 || n === 1) return 1;
return stairs(n-2) + stairs(n-1);
}
Thank you so much mate!
You are welcome! Thanks for your comment!
Thank you, bro. It's very helpful now.
Glad it helped you! You are welcome!
why do we need to specify the n==1 case?
if (n
The way he codes it it would throw a runtime time error since right after dp[1] = 1 you say dp[2] = 2. Index 2 is outside of the bounds of the array (size is 2, last index is 1)
thanks a lot! Amazing
You are welcome! Thanks for your comment!
thank you!
You are always welcome! Thanks for the comment!
Thanks alot that was pretty clear.
Thanks a lot for your feedback!
Fibonacci
thnks really easy code to understand
Thanks for watching!
Thanks man
You are welcome, man!
thanks
Нихрена не объяснил. Чисто заготовку напечатал
Ну не знаю, вроде все должно быть понятно