Climbing Stairs | LeetCode 70 | C++, Python

preview_player
Показать описание

**** Best Books For Data Structures & Algorithms for Interviews:**********
*****************************************************************************

July LeetCoding Challenge | Problem 31 | Climbing Stairs | 31 July,
Facebook Coding Interview question,
google coding interview question,
leetcode,
Climbing Stairs,
Climbing Stairs c++,
Climbing Stairs Java,
Climbing Stairs python,
Climbing Stairs solution,
70. Climbing Stairs,

#CodingInterview #LeetCode #JulyLeetCodingChallenge #Google #Amazon #Climbing stairs
Рекомендации по теме
Комментарии
Автор

I don't know about everyone, but I can't get it into my head how the recurrence relation came up to be f(n) = f(n - 1) + f(n - 2). How did we conclude the resulting num of steps is summing steps at n - 1 with steps at n - 2 🤯

Omar-hwzi
Автор

thankyou sir, because of you i completed july challenge

gouravgoel
Автор

i solved the code by your approach, thanks

programmingrush
Автор

Sir do you teach for fun? I really enjoy intuition in your videos.

heyrmi
Автор

Thanks! So this approach is Sliding Window Algorithm, right?

gawarivivek
Автор

Sir, please make a video on leetcode problem no 472-->Concatenated Words if you have free time.

anikpatra
Автор

Kindly sir please upload a video on kosaraju algorithm it will be a great help

raviashwin
Автор

class Solution {
public:
unordered_map<int, int> mp;
int climbStairs(int n) {
if(n <=2)
mp[n] = n;
for(int i = 1; i < n; i++)
{
if(mp.find(n) == mp.end())
{
mp[n] = climbStairs(n - 1) + climbStairs(n-2);
}
else
return mp[n];
}
return mp[n];
}
};

thank you sir..but i used memoization also

tushankpanchal
Автор

talking too slowly..please speed up your pace..even at speed 2, it still sounds slow

kotravaijm
welcome to shbcf.ru