Climbing Stairs - Leetcode 70 - Part 2 - Java

preview_player
Показать описание
Climbing Stairs - Leetcode 70 - Part 2 - Java

--------------------------------ABOUT--------------------------------
🧑🏻 My name is David and I am a software engineer at Meta. My passion is teaching software devs how to pass the grueling technical interviews to help them land their 6-figure dream tech job.

I have received 3 six-figure offers from Google, Meta, and Amazon.

🔬I provide content that will allow you to understand the thought process, pseudocode, time complexity, and code when approaching coding problems.

--------------------------------SOCIAL--------------------------------

💬 If you have any topic or questions you want me to cover, let me know in the comment section below ~ ฅʕ•ᴥ•`ʔ ฅʕ•ᴥ•`ʔ ฅʕ•ᴥ•`ʔ

#technicalinterview #techcareer #softwareengineer
Рекомендации по теме
Комментарии
Автор

great explanation! . i have two ques: in base case of n==0, why we take 1 and not 0 as result as already at the destination ie bottom? Secondly, my code is giving TLE for n=44 in LC: class Solution {
public int climbStairs(int n) {
int[] memo= new int[n+1];
Arrays.fill(memo, 0);
if(n==0 || n==1){

return 1;
}
if(memo[n]!=0) return memo[n];
memo[n]=
return memo[n];

}
}

balrajkaur
visit shbcf.ru