Get Stairs Path - Solution | Recursion | Data Structures and Algorithms in JAVA
Vložit
- čas přidán 7. 09. 2024
- Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the solution of the get Stair Path problem where we are required to find the stair path to reach the bottom most level from any level n above. For a better understanding of the Stair Path problem, click here: • Get Stairs Path - Ques...
For a better experience and more exercises, VISIT: www.pepcoding....
#pepcoding #programming #freeonlinecourses
Have a look at our result: www.pepcoding....
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education
Even the paid courses cant teach this level. Lots of appreciation to u sir🙏🙏
The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
So, keep motivating and Keep loving😊
at 5:35 ur old habbit of gungunana can b seen as seen in class , great sir u r having same enthusiasm in video as class!!!
u r simply fantastic!
Sir ji ye kis line me aagaye aap . Mast hai.
Sumeet Sir previously, I used to go to GFG and search a topic and do those selected problems but now PepCoding Playlist laga dala to Life Jinga Lala 😂
Thank you for the trust
same bro
Amazing!!!!!!!! Sir samajh nhi aa rha ki kaise express karun. But these series are gems! I feel so overwhelmed while learning from you, I feel like crying sometimes when I understand things so easily because of the way you teach them. I hope to meet you one day in person and tell you how thankful I am to you for teaching so perfectly and making our lives easier. Teachers like you are rare to find. Thanks a ton for the efforts. :')
I am glad. Keep learning. Keep supporting. Your kind words are the kind of motivation that truly help me in making more and more content. Especially, these days, not everybody is generous with motivating anybody either. It means a lot😊
keep learning and keep loving Pepcoding🙏
This is the most underrated channel in you tube.
Please support us by sharing us around
Euler explanation made it crystal clear, will never forget
Sumit sir.. prabhu you are amazing you deserve Oscar 🥺🥺🙏😭
Really love the way you teach, your method gets imprinted on the memory so easily that I do not have to watch it again and again as everything becomes so clear the first time itself. You are so great for providing this content totally free. I shared it with my many friends and they also loved it and thinks so highly of you.
Thankyou beta,
I am glad you liked it. I also hope that you are watching till end.
If you like our efforts, will you like to write a few words about us here -(www.quora.com/Which-is-the-best-institute-for-coding-in-Delhi)
@@Pepcoding I went to write, but the page is not present now
"दमदार देसी"
I have fourteen years of experience in software development. I can firmly say the way you taught recursion no one ever did that. It's practical and useful. I have lots of admiration and appreciation for you.
Thanks a lot for your hard work and teaching style.
Keep up the good work!!
THANK YOU!
Keep learning.
And for better experience and well organised content visit nados.pepcoding.com
This is one of the best playlist for recursion,from these lectrues anyone can learn how solve recursion based question very easily,Thank you so much Sir.
Best channel on youtube.
Thank you very much. Subscribe kijie, bell button dbaie. Aur college mei to share kar kar ke pakka dalie.
I was not able to understand recursion tree but Sumit Sir made easy to solve medium and hard question ❤🙏
Amazing way of teaching sir .. your teaching skills are far better than that of my college professors:)
Shukriya beta!
I am glad you liked it. I hope that you are watching the videos till the end. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc
Hi sir, your way of teaching and approaching a problem is amazing!
Ab to atti krdi Sir but ab smjh aa gya😌..Thank you Sir for making available this next level content for free🔥
wow, this cheers me up. I am glad we at pepcoding could be of help to you. Keep learning. Also, recommend us to your juniors and peers, they may also benefit.
Isse shandaar aaj Tak nhi dekha tha meine amazing explaination
Cheatsheet to bhot utubers ne di Ds/Algo ki ..But we want this kind of stuff..thanks a ton to u sir..🙏🙏
U may will prove life changer for me..
wow, this cheers me up. I am glad we at pepcoding could be of help to you. Keep learning. Also, recommend us to your juniors and peers, they may also benefit.
Kyaa baat hai sir App toh bde rangeen mizaaz ke nikle . . .
:-)
Brother, you sing great as well... you are the man.. ! Real Sultan in Real world.
Sir, for first time..seeing you in a T-Shirt..
You are looking awesome! :)
So nice of you
Explanation Level : God , I know have faith that I could learn recursion
Glad to know that you liked the content and thank you for appreciating.
The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
So, keep motivating, keep learning and keep loving Pepcoding😊
ary sir kya padhaate ho aap ,mazaaa sa kaat dete ho.social media vgrha pe bahut kam marketing h apki otherwise aapka startup pepcoding jis speed se grow kar rha h abhi uski bhi 2^n se krta . mah isliye aisa kehra hu i donot see single advertise about pepcoding ,bas youtube pe kuch question search kr rha tha ekdin to aapka channel mil gya .Der se mila thoda par mil gya yehi bahut h
one of the best dry run and explanation sir i have ever seen. Thank you for making Level 1
sir is the best, i used to be so scared of this type of coin change problems
This is the only channel that tells you actual reasoning on others there is only ratta
wow, this cheers me up. I am glad we at pepcoding could be of help to you. Keep learning. Also, recommend us to your juniors and peers, they may also benefit.
Thank you so much sir! Draw krke aap jo samjhate hain is on another level.💯
sir maine paid course lia hua tha but believe me apki free contents best hai unse
Thank you so much and If you like the content could you post something on LinkedIn about us? This will help us in reaching out to more people and help a lot of other students as well
Something like this
Sumeet Malik from Pepcoding is making all his content freely available to the community
You can check it out here - www.pepcoding.com/resources
/
Also, this is the youtube channel - czcams.com/users/Pepcodingplaylists?view_as=subscriber
Sir your way of teaching is really superb ...
Sir why did we used exactly 3 faiths here, why not 2 or 4 or 5 or any other number.
bcz in the ques its given either we can take 1 step, 2 steps or 3 steps at a time, so we take these faiths
@@kashvirelhan4544 i understood , thanks 👍
as always Awesome explanation sir 🙏🙏 you are great teacher.
kash Btech me aapke 10% bhi samjhane wale teacher hote to FAANG was nothing :)
Beta, aisa nh h. Teachers saare he aache hote h but hm insaano ko time pr kisi cheez ki value smjh nh aati.
Watched on 21st October, 2021 - Thanks for the video.
yes sir your explanation is very helpfull thanks so much
Sir aaj bht kuch muh par laga dia ab kabhi nhi bhulenge
1. You are given a number n representing number of stairs in a staircase.
2. You are standing at the bottom of staircase. You are allowed to climb 1 step, 2 steps or 3 steps in one move.
3. Complete the body of getStairPaths function - without changing signature - to get the list of all paths that can be used to climb the staircase up.
.
.
sir question me to niche se upar jana h ...apne to upar se niche la diya.Correct me if i am wrong!
Answer to dono me same hi aaega vaise.. to approach bhi same hoga ?
hanji. question badal ke bhi paths to same he aaenge. jo upar se neeche jane ke raste hain wo same follow karke neeche se upar bhi to ja he sakte hain
pyar dharti par farishto se kiya nahi jaata....voice toh acchi hai
Your way of teaching is amazing sir. Thanks a lot for helping us .
Glad you liked it!
Keep learning.
And for better experience, visit nados.io, where you will get well curated content and career opportunities.
public static ArrayList getStairPaths(int n) {
if(n
Sir, in arrayList, why have you taken string as the datatype even thou we are using integer here?
Sir, there is a doubt. in question, it is given that you can jump 1 step or 2 steps or 3 steps, but there not mentioned that you can just stand there. so why you have included the 0th step as one,
Brilliant explanation sir. another great masterpiece from u
So nice of you
A very rare view of sumit sir chilling while coding on lofi beats 5:38 😍😍😍😍🌹
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
True love for pepcoding
keep motivating, keep learning and keep loving Pepcoding😊
Sir kya padate ho aap.. awesome..
Thank you sir.
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
Very well explained Sir,
Thanks for liking
thoda bhari ho rha h..par maza aa rha hai..all thanks to u sir
beta, mehnat karni hai. Koshish karke roj baithna hai, thode dino mei asaan lagega.
@@Pepcoding ji sir
what a effort 😮
just wondering, what will be the time and space complexity will be for this solution
@pepcoding I am so glad that I have a mentor like you. you are such a nice soul there is a little feedback from my side is that please discuss the space and time complexity in your videos this is much-needed rest of thing is so great.
Thank you so much!! will be doing complexity analysis later
Why we consider only (n-1),(n-2),(n-3) , we cannot consider (n-4)
as per the question we can move 1,2 or 3 steps only at max
Very good explanation , sir . Thanks !
11:32
zero v sidhi se zero v sidhi jane ka rasta hota h ki chalo hi mat 🤣🤣🤣
Bahut sahi sir
Thanks sir for these amazing videos.😊
sir foundation ke question khud ni bnn rhe aapki videos dekho to firr samaj aa jaate hai kya kru?
Bilkul koi burai nahi hai. Aise dheere dheere aapki ungliyo se code nikalne lagega.
I did not know how to think like that. So zyadatar jab edge cases aate jaise n
The best part is when he sings when he codes
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
If you like our efforts, we request a review
g.page/Pepcoding/review?rc
You can subscribe to our channel here
czcams.com/users/Pepcodingabout?view_as=subscriber
khudse try karte karte hi ban gaya
What if we want to count number of paths without using arraylist
did this on my own in 15-20 min :)
Good
Sir, why in the Faith, 3 case are discussed (n-1), (n-2), (n-3). It could have been more or less?
Iss question ke anusar 3 he immediate jumps allowed hain
You are allowed to climb 1 step, 2 steps or 3 steps in one move.
Pepcoding is the new GFG
God level Explaination !!
for better experience why don't you use this same content on nados.pepcoding.com?
Thanks sir ji.
But i wanted to take a course from your training center. I am from bangladesh.
Once i asked for query but sir ji i didn’t got satisfying ans.
Beta text me on LinkedIn
God or what♥️
Just one word amazing
vector getStairsPath(int n) {
if(n == 0) {
vector mres;
mres.push_back("");
return mres;
}
vector mres;
for(int i = 1; i
lol i did for n number of stairs.
void printStairsPath(int n, string path) {
if(n == 0) {
cout
Really an awesome video
Thankyou beta!
If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
Why are we using string type of arraylist and why not integer arraylist?
For better insight, visit nados.io, post your doubts, community will help you out there.
thank you so much sir.🙏🙏
Why would to take only three array list of(n-1)and (n-2) and (n-3) you can also take (n-4) or done with only two ?
You are allowed to climb 1 step, 2 steps or 3 steps in one move.
Maja agya bhidu❤❤❤❣❤❤❤💖🧡🧡🧡
Sir , why do we need this calls for paths?
god level explanation !!!
Glad to know that you liked the content and thank you for appreciating.
The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
So, keep motivating, keep learning and keep loving Pepcoding😊
Sir, I am struggling with the time and space complexity for this code.....can you explain it?
beta mai ek din rat ko 10 pm wale webinar mei time and space discuss karunga detail mei.
@@Pepcoding okh sir thanks
@@Pepcoding is it exponential ?
@@Pepcoding sir can we say that jab bhi recursive tree banega tab exponential time complexity hogi (generally)? jaise hum log array traversal ko generally order of n bolte hai waise ?
bhiaya iska ArrayList ka type string hai toh ye integer kaise return kar rah hai sorry agar apko bekar laga doubt to
ArrayList of String he return kar rha hai. String mei integer to daal he sakte hain. Jaise "1234" is a string while 1234 is an integer.
Are sir basically jeb hem apna gher string ke liye bna rhe hai to usme int as string jayega esliye sir ne data type uska string rakha hai leptop me aap kerke dekh lijiye koi example leker
I'm coding in c, but arraylist is not in c, so can u give me some hint how can I code in c
Very nice explanation.
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
Will you like to write a few words about us here - g.page/Pepcoding/review?rc
Sir, can u please post one of the solution video of any of these question in c++, so that we get an idea of how to do it with a help of vector, as i am coding in c++
will be doing everything in c++ in second iteration of the content
maza aayga pdna ab
Sir till which month Foundation and Level up will be completed on CZcams.
foundation to july 31 tak ho jaega. levelup 15th aug tak. interview prep 30th aug.
@@Pepcoding are great sirji.
Thankyou very much
Why did we stop at n-3 and not go further. For example to n-4, n-5 etc..
Question itself was saying that we can either take 1 or 2 or 3 steps so....
GOD💙
THE LEGEND !
Whoever came here after question in CN thumbs up!!
sir in question it saying for climbing to stairs not to go down the stairs.
Beta, vo problem ko analyse krne ka tarika h.
Hi sir how can we define how many recursion function we have to declare
Apko jo allowed hain steps to take utne hi recursion calls lagani hain.
Like u r allowed in this question to take 1 step at a time, u can take 2 steps at a time or u can take 3 steps at a time. So these are total of 3 options (1,2,3). That's y 3 recursion calls to define. So it deoends on options.
@neha6000
@@John12685 aree toh ese infinite option hote toh kbtk likhte rhte
Dhanyawad sir. kya saalintaa hai aapme.
Brilliant
isme DP bhi use kar sakte hain
ArrayListpaths=new ArrayList();
how its work
anybody plz explain this
I don't know much about java
Here, we are creating an arraylist of strings which is named as paths; so that when we pass through getStairPaths function, after execution of code, the output is return to this arraylist and printed.
@@GALISUBHASHKARTHIKBCE thanku
Thank you so much sir
Keep learning and keep supporting😊
If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc
Awesome ❤️
Keep learning and keep supporting Pepcoding😊
Sir can c++ guy ,watch your playlist?
Why did we take 3 paths here?
Sir why we set all instructions in post order
Sir 2 bar dekha thinking samgh aa gyi ki kyo postorder liya kyo tree bnayi and also faith and expection kaise chel rhe hai milker aisha lag rha hai alag hi level pdate ho
tumse milke aisa lga.. tumse milke armaan hue poore dil ke.. la la la!
To share karein aur subscribe karein bhot jald
patience == sumeetSir
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
If you like our efforts, we request a review
g.page/Pepcoding/review?rc
You can subscribe to our channel here
czcams.com/users/Pepcodingabout?view_as=subscriber
For clearing your doubts, you can join our community on telegram
t.me/pepcoding
@@Pepcoding I'm already a subscriber ❤️ Review posted !! And thanks for the telegram link..🙌
Thanku sir❤️❤️
op sir
Sir yeh kaise pata lagega ki kab kaam inorder me karna hai ya postorder me ya preorder me?
By practicing different types of questions
5:35 better than tony kakkar