Leetcode 70. Climbing Stairs [Java] | Two best approaches
ฝัง
- เผยแพร่เมื่อ 19 เม.ย. 2021
- Check out how to solve the leetcode 70 Climbing Stairs question in Java. This is one of GOOGLE's most commonly asked coding interview questions according to Leetcode. In this video, you will see two possible solutions which both are faster than 100% of the leetcode submissions.
Question URL: leetcode.com/problems/climbin...
Please write in the comments below which leetcode problem you want me to solve next.
And remember, a leetcode a day keeps unemployment away!
Thanks for watching!
#leetcode70 - วิทยาศาสตร์และเทคโนโลยี
thank you!
You are always welcome! Thanks for the comment!
Thank you, bro. It's very helpful now.
Glad it helped you! You are welcome!
Thank you so much mate!
You are welcome! Thanks for your comment!
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);
}
Fibonacci
thanks
Thanks alot that was pretty clear.
Thanks a lot for your feedback!
thanks a lot! Amazing
You are welcome! Thanks for your comment!
thnks really easy code to understand
Thanks for watching!
Thanks man
You are welcome, man!
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)
Нихрена не объяснил. Чисто заготовку напечатал
Ну не знаю, вроде все должно быть понятно