Climbing Stairs (LeetCode 70) | Full solution with animations | Dynamic Easy | Study Algorithms

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.ค. 2024
  • Given a staircase with n steps, we need to find the total number of distinct ways to climb it by taking 1 or 2 steps at a time. Sure, this can be done by a brute force method and finding all the possibilities, but there is a really easy way to understand this. This video shows how you can form building blocks and ultimately arrive at a very efficient solution. To make things easy, there is also a dry run of code in JAVA.
    Chapters:
    00:00 - Intro
    01:36 - Problem statement and description
    04:51 - Brute Force Method
    07:28 - How to understand and attack
    09:41 - Finding an efficient solution
    12:19 - Dry-run of Code
    14:45 - Final Thoughts
    Actual problem on LeetCode: leetcode.com/problems/climbin...
    📚 Links to topics I talk about in the video:
    Dynamic Programming: • Dynamic Programming ea...
    Brute Force Solution: • Brute Force algorithms...
    What is Big O?: • Big O Notation Simplif...
    📘 A text based explanation is available at: studyalgorithms.com
    Code on Github: github.com/nikoo28/java-solut...
    Test-cases on Github: github.com/nikoo28/java-solut...
    📖 Reference Books:
    Starting Learn to Code: amzn.to/36pU0JO
    Favorite book to understand algorithms: amzn.to/39w3YLS
    Favorite book for data structures: amzn.to/3oAVBTk
    Get started for interview preparation: amzn.to/39ysbkJ
    🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
    🎥 My Recording Gear:
    Recording Light: amzn.to/3pAqh8O
    Microphone: amzn.to/2MCX7qU
    Recording Camera: amzn.to/3alg9Ky
    Tablet to sketch and draw: amzn.to/3pM6Bi4
    Surface Pen: amzn.to/3pv6tTs
    Laptop to edit videos: amzn.to/2LYpMqn
    💻 Get Social 💻
    Follow on Facebook at: / studyalgos
    Follow on Twitter at: / studyalgorithms
    Follow on Tumblr at: / studyalgos
    Subscribe to RSS feeds: studyalgorithms.com/feed/
    Join fan mail: eepurl.com/g9Dadv
    #leetcode #programming #interview

ความคิดเห็น • 158

  • @pcccmn
    @pcccmn 2 ปีที่แล้ว +36

    I have watched NeetCode, CS Dojo and Kevin Naughton's explanation but couldn't understand the concept behind arr[target] = arr[target-1] + arr[target-2] for this problem until I came across your "How to understand and attack" segment. Thank you for explaining like I'm 5.

    • @Arcadencebeats
      @Arcadencebeats ปีที่แล้ว +2

      I had the same issue. He explained it so much better!

    • @edoreemmanuel4250
      @edoreemmanuel4250 7 หลายเดือนก่อน +1

      I am just seeing this..I love the explanation...lols....

    • @testing-js8iu
      @testing-js8iu 4 หลายเดือนก่อน +1

      yes you right

  • @srikarjonnala6509
    @srikarjonnala6509 9 วันที่ผ่านมา +1

    such a lovely solution and explanation

  • @horcruxone
    @horcruxone 2 หลายเดือนก่อน +2

    Handsdown the best explanation available on youtube for leetcode 70!

  • @susmitobhattacharyya1668
    @susmitobhattacharyya1668 7 หลายเดือนก่อน +1

    Thanks for your simple explanation.

  • @kasifmansuri7552
    @kasifmansuri7552 10 หลายเดือนก่อน +1

    Great explaination!!

  • @Ranjan-xc5nl
    @Ranjan-xc5nl 27 วันที่ผ่านมา

    Provides sound explanation of algorithmic approach and solution, indeed worthy channel. Thanks.

  • @dirtbag1126
    @dirtbag1126 10 หลายเดือนก่อน

    Great video! Loved the visuals. You did an excellent job at breaking down the steps needed to approach this problem. Keep it up!

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน

      glad you liked it. If you want to see more content like this, consider joining my channel: th-cam.com/channels/T-S2ngqEBoYCM5UKuNeELg.htmljoin

  • @ajaygunalan1995
    @ajaygunalan1995 ปีที่แล้ว +1

    Dude, you nailed it. LOVE YOU!

    • @nikoo28
      @nikoo28  ปีที่แล้ว +1

      Glad you enjoyed it 😄

  • @jamjam3448
    @jamjam3448 2 หลายเดือนก่อน

    Wowww. Thanks a million bro. After watching many turotials on this, yours is the best! I've understood it! Thanks

  • @yousefnegmeldin5903
    @yousefnegmeldin5903 หลายเดือนก่อน

    Thank you so much, you helped me understand dynamic programming with such a simple explanation and example.

  • @niktri6805
    @niktri6805 14 วันที่ผ่านมา

    Really excellent explanation, the breakdown of the problem made it much more easier to understand.

  • @vasavi5908
    @vasavi5908 9 หลายเดือนก่อน

    Great explanation.Thank you very much

  • @arjunb9342
    @arjunb9342 ปีที่แล้ว

    Thank you so much... Best and Easiest explanation ever .

  • @rubylnic
    @rubylnic 11 หลายเดือนก่อน

    thank you for the great explanation!

  • @purnachandrasahu622
    @purnachandrasahu622 5 หลายเดือนก่อน +1

    This was really helpful!!
    Keep up the good work..

  • @vsh-torch
    @vsh-torch 2 ปีที่แล้ว +1

    Good one, bro. Thank you.

  • @kunalchauhan5294
    @kunalchauhan5294 5 หลายเดือนก่อน +1

    Thank you soo much this is my 1st dp question I'm glad i found good description of it thank a lot you are a great tutor

  • @sukanyaghosh24
    @sukanyaghosh24 9 หลายเดือนก่อน

    Omg such an amazing explanation, thank you so much sir 🙏❤️

  • @dailyprograming9003
    @dailyprograming9003 10 หลายเดือนก่อน

    your explanation skill is too good

  • @rinkishaw1929
    @rinkishaw1929 2 หลายเดือนก่อน

    Great video ❤

  • @minecraftredstoneinspiration
    @minecraftredstoneinspiration ปีที่แล้ว

    Really well explained.

  • @sa35085nhs
    @sa35085nhs 5 หลายเดือนก่อน +1

    I read one of comment which was recently posted, but u replied to that comment also,great !!!

  • @_Adil.Khan_
    @_Adil.Khan_ 2 ปีที่แล้ว +1

    I will say just fantastic!

  • @hommy4850
    @hommy4850 ปีที่แล้ว

    well explained thanks you!!

  • @vichitrakalakaar
    @vichitrakalakaar 2 ปีที่แล้ว +3

    I tried to solve this problem using recursion but TLE.... And you just gave me best solution .... Thank you so much guru🔥💯❤️🙏

  • @AkashYadav-di6kd
    @AkashYadav-di6kd 6 หลายเดือนก่อน +1

    Thank you very much, sir.

  • @gauravkumar-ek8mr
    @gauravkumar-ek8mr 2 ปีที่แล้ว

    Adbhoot. Love your explanation

  • @Rajendrachoudhary-ut8ll
    @Rajendrachoudhary-ut8ll 2 หลายเดือนก่อน

    Awesome explanation

  • @yashthakur5712
    @yashthakur5712 6 หลายเดือนก่อน

    hats off to you sir, excellent explanation, and thnks a lot

  • @ritendahiya8828
    @ritendahiya8828 5 หลายเดือนก่อน +1

    Thank you sir!!

  • @codeflix927
    @codeflix927 ปีที่แล้ว

    it's Amazing explanation . I loved it.❤❤❤❤❤❤❤❤❤❤❤❤

  • @Deepz007
    @Deepz007 2 หลายเดือนก่อน +1

    Yours was the best explanation.

  • @ParmodYadav
    @ParmodYadav 5 หลายเดือนก่อน

    Very good way to teach brother very depth understanding of the question very good

  • @kunalkheeva
    @kunalkheeva ปีที่แล้ว

    great content!

  • @kavinsanthosh1306
    @kavinsanthosh1306 ปีที่แล้ว

    Great explanation! This is my first DP, Memoisation Problem!

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      you are gonna love dynamic programming. Check out House Robber as well. th-cam.com/video/VXqUQYGMnQg/w-d-xo.html

  • @apuravsharma9995
    @apuravsharma9995 7 หลายเดือนก่อน

    Great explanation

  • @fourieruddin871
    @fourieruddin871 5 หลายเดือนก่อน +2

    Your excitement for teaching has no bounds 🙏

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      thanks for your kind words

  • @kanimozhikani7138
    @kanimozhikani7138 8 หลายเดือนก่อน

    Thank you so much sir🎉

  • @nerd6134
    @nerd6134 2 ปีที่แล้ว +14

    If this guy makes a math course it’ll be one of the best.

    • @ankithareddy4497
      @ankithareddy4497 5 หลายเดือนก่อน

      true..and everyone will start coding.

  • @sammedpatil3907
    @sammedpatil3907 2 ปีที่แล้ว

    very nice method of explanation....

  • @mohitarya5189
    @mohitarya5189 ปีที่แล้ว +1

    Thank you 😊😊

  • @tiyashasen5020
    @tiyashasen5020 ปีที่แล้ว +1

    You teach amazing. Thanks for making us understand difficult concepts in a simple way🙂

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      Glad you feel this way :)

  • @TaufeeqAhmed-hk4rz
    @TaufeeqAhmed-hk4rz 4 หลายเดือนก่อน

    Awesome Explanation bro

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      Thank you so much 🙂

  • @user-wg6nk7ix7x
    @user-wg6nk7ix7x 6 หลายเดือนก่อน +2

    Man great breakdown of this problem, simply the best!

  • @priyagupta5139
    @priyagupta5139 หลายเดือนก่อน

    Your Explanation is very good.

    • @nikoo28
      @nikoo28  หลายเดือนก่อน

      Glad you think so!

  • @Arcadencebeats
    @Arcadencebeats ปีที่แล้ว

    Thank you so much!

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      You're welcome!

  • @zb2747
    @zb2747 ปีที่แล้ว +7

    Man great breakdown. I'm doing interview prep by grinding on leetcode and your videos have been a great way for me to understand how to solve set problems. You do a great job of talking slowly but not too slow and breaking the problem down that is simple to understand.

  • @adnaan28
    @adnaan28 2 หลายเดือนก่อน

    just an amazing explanation

    • @nikoo28
      @nikoo28  26 วันที่ผ่านมา

      Glad you think so!

  • @MrMichalXXL
    @MrMichalXXL 7 หลายเดือนก่อน

    I was skeptical but in the end you delivered the understanding

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน

      glad i could help you

  • @carlosraul6578
    @carlosraul6578 10 หลายเดือนก่อน

    Thanks my bro

  • @latest_news_stories
    @latest_news_stories ปีที่แล้ว +1

    Lit 🔥very well explained

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      You too are awesome 😎

  • @data10xwithsandeep
    @data10xwithsandeep 2 หลายเดือนก่อน

    Boss you are a king of coding and the best teacher

    • @nikoo28
      @nikoo28  2 หลายเดือนก่อน

      Thank you so much

  • @shortme9374
    @shortme9374 2 หลายเดือนก่อน

    Hey Nikhil, I really liked your way of explanation. keep making such videos. Subscribed.

    • @nikoo28
      @nikoo28  2 หลายเดือนก่อน

      Thanks for the sub!

  • @kuoyulu6714
    @kuoyulu6714 ปีที่แล้ว

    just starting my leetCode journey, with no math background, this video helped me so much, thanks a lot!

    • @nikoo28
      @nikoo28  11 หลายเดือนก่อน +1

      I wish you all the very best :)

    • @kuoyulu6714
      @kuoyulu6714 11 หลายเดือนก่อน

      @@nikoo28 thanks!

  • @Mr.Zeus11
    @Mr.Zeus11 2 หลายเดือนก่อน

    Thank you so much, first time while I saw the problem, i was like WTH how I am gonna solve this. After seeing your video it's so easy!! ❣

    • @nikoo28
      @nikoo28  2 หลายเดือนก่อน

      Love it!!! 😁

  • @ram_mandir_india
    @ram_mandir_india 7 หลายเดือนก่อน

    The way you explained it made it so easy to understand. Thank you, my friend, for helping me in my first dynamic programming question. Love from Haryana.

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน

      You're very welcome!

  • @RakshithVrishab-ht8vk
    @RakshithVrishab-ht8vk 8 หลายเดือนก่อน

    The best explanation i have come across, i have watched other videos of same problem from other instructors , their explanation was also good, but Nikhil the way you've explained is so simple and top notch, thank you very much

    • @nikoo28
      @nikoo28  7 หลายเดือนก่อน

      really glad you feel that way 😄

  • @TrueRDX
    @TrueRDX ปีที่แล้ว

    thanks very much for explain dp 🤗

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      Thank you so much 😊

  • @SHAIKAFTABAHMED-gz9wu
    @SHAIKAFTABAHMED-gz9wu 5 วันที่ผ่านมา

    Bro u r really a bro ....

  • @sathiroy4788
    @sathiroy4788 ปีที่แล้ว

    Nice explanation.

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      Keep watching

  • @rajnishroy7429
    @rajnishroy7429 ปีที่แล้ว

    thank u..

  • @sreeharsharaveendra289
    @sreeharsharaveendra289 6 หลายเดือนก่อน

    Best explanation behind the thought process of approaching the problem. I think we can reduce the space complexity to O(1) because we just need to return the value for the number of ways to reach the nth step. So a sliding window approach can also work, which is kinda similar to dynamic programming, but you don't memoize all values, just the previous 2 values and keep updating it.

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน

      Excellent

  • @rishabhsinghal5823
    @rishabhsinghal5823 ปีที่แล้ว

    very nice explanantion baat to hai..

  • @nikhilmishra8266
    @nikhilmishra8266 5 หลายเดือนก่อน

    observing the output we can also use simple fib program

  • @filmbuzz9419
    @filmbuzz9419 9 หลายเดือนก่อน

    Nice

  • @1tav0
    @1tav0 2 ปีที่แล้ว +4

    I wish you could have been my teacher for dsa! You are a true teacher, this was so simple to follow I want to cry. Thank you so much sir! Please keep making this type of videos they are life savers for people like me! Thank you thank you! Please could you touch upon recursion and tree problems please !

    • @nikoo28
      @nikoo28  2 ปีที่แล้ว +2

      Thank you so much for your kind words. I do have videos on recursion and tree problems. Check out my playlist on algorithmic paradigms. :)
      I hope they are helpful too.

    • @santoshibora1892
      @santoshibora1892 11 หลายเดือนก่อน

      @@nikoo28 why array is of n+1 size, why cant n??

    • @krishkhemani96
      @krishkhemani96 5 หลายเดือนก่อน

      ​Bcz index starts at 0 if you want to calculate the 8 step you need ans of 8th index but if u pick array of size n you would be providing ans of 7th index instead of 8​@@santoshibora1892

  • @abhishekkr8077
    @abhishekkr8077 11 หลายเดือนก่อน

    Bahut badhiya padhate ho sir aap 🙏

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      thank you so so much

  • @abhishekkeshri3974
    @abhishekkeshri3974 ปีที่แล้ว

    you make me fall in love with dynamic programming .please do a live talk with us and give some advices for interview . thanks for the video nikhil.

    • @nikoo28
      @nikoo28  ปีที่แล้ว +1

      glad you liked the video. Check out my latest video on Edit Distance too. Just uploaded it today :)
      I will have a youtube live coming up soon.

    • @abhishekkeshri3974
      @abhishekkeshri3974 ปีที่แล้ว

      @@nikoo28 glad to know. We like to talk with you.

  • @DeveloperJay
    @DeveloperJay 4 หลายเดือนก่อน

    the way of explaining was very very good. but we can use simple Fibonacci approach as well.

    • @nikoo28
      @nikoo28  3 หลายเดือนก่อน

      but how would you know that it is a fibonacci sequence??

  • @omkarkhandalkar8869
    @omkarkhandalkar8869 2 ปีที่แล้ว

    Really helpfull sir
    The way you're explaining is >>>>>>>>>>>>>>>>>>>>>>>>> any other course or youtube channel

    • @nikoo28
      @nikoo28  2 ปีที่แล้ว

      It will be so helpful if you tell about my channel to your friends/colleagues as well 😃

    • @omkarkhandalkar8869
      @omkarkhandalkar8869 2 ปีที่แล้ว

      @@nikoo28 yes sir shared with community groups

  • @omarkhan5223
    @omarkhan5223 11 หลายเดือนก่อน

    Great video, what tool are you using with your pen to make those bright red lines?

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      that is an application called GoodNotes 6

  • @skrishnan9625
    @skrishnan9625 5 หลายเดือนก่อน +1

    This problem can also be done with the help of recursion

  • @prashanthshetty8337
    @prashanthshetty8337 3 หลายเดือนก่อน

    This can be done using 2 ints as well.
    ```golang
    func climbStairs(n int) int {
    if (n == 1 || n == 2) {
    return n
    }
    a, b := 1, 1
    for i := 2; i < n; i++ {
    a, b = b, b + a
    }
    return a + b
    }
    ```

  • @shivashankar6043
    @shivashankar6043 7 หลายเดือนก่อน +2

    So, its a modified question of finonacci series problem

    • @nikoo28
      @nikoo28  7 หลายเดือนก่อน

      not exactly...it just happens to have a fibonacci pattern.

  • @jritzeku
    @jritzeku 6 หลายเดือนก่อน

    Is it bad to use recursive solutions for dynamic programming? I simply used recursion similar to fibonacci and then to make it more performant used a memo obj. That way it will avoid recursion for already encountered inputs. The tabulation approach seems lot less intuitive for more complex problems.

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน +1

      I won't say bad to use recursion but it is definitely less intuitive. When something goes wrong it is very hard to trace what happened, and fixing it becomes problematic. Recursive solutions look small for sure, but it is not necessary that they take less space as well.

  • @Muhammed___koya
    @Muhammed___koya 12 วันที่ผ่านมา

    but if the no of stairs is 1 your code will cause indexoutofboundexception. In order to avoid that you should initialize 0 index value and 1 index value to 1 and run the loop starting from i=2;

  • @filmbuzz9419
    @filmbuzz9419 8 หลายเดือนก่อน

    Min Cost Climbing Stairs also make vedio on these quation

    • @nikoo28
      @nikoo28  8 หลายเดือนก่อน +1

      let me find it

  • @Kemba_oak
    @Kemba_oak หลายเดือนก่อน

    this feels exactly like Fibonacci sequence

    • @nikoo28
      @nikoo28  หลายเดือนก่อน

      Yes, but you need to arrive at that conclusion first

  • @agentphoenixtm642
    @agentphoenixtm642 10 หลายเดือนก่อน

    Isnt this is tabulation rather than memoization? As we following bottom up approach from base case to final result 13:37

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน

      by tabulation if you mean storing all results in a table, then yes it is the same. Memoization is just a concept to store your calculated results, you do it in any data structure you like as long as you are saving space/time.

  • @sukanyaghosh24
    @sukanyaghosh24 9 หลายเดือนก่อน

    Sir please make a series of all the 150 neet code questions using java, it's a humble request 🥺

    • @nikoo28
      @nikoo28  8 หลายเดือนก่อน +1

      Will upload soon

    • @sukanyaghosh24
      @sukanyaghosh24 8 หลายเดือนก่อน

      @@nikoo28 thank you ☺️

  • @machans-203
    @machans-203 2 หลายเดือนก่อน

    You can reduce space complexity to O(1). It's a fibonnaci series in other name👍

    • @nikoo28
      @nikoo28  2 หลายเดือนก่อน

      But you need to understand the problem before you can derive the fibonacci series

  • @sanketsuryawanshi
    @sanketsuryawanshi 2 ปีที่แล้ว

    Sir please make whole series on Tree,Graph, DP plz sir

    • @nikoo2805
      @nikoo2805 2 ปีที่แล้ว

      Hi, check my playlists on the channel.
      Currently I am trying to add as many videos as I can…but just limited by the time I have available :)

    • @sanketsuryawanshi
      @sanketsuryawanshi 2 ปีที่แล้ว

      @@nikoo2805 Thanks sir no problem

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      The complete playlist on graphs is now available: th-cam.com/play/PLFdAYMIVJQHNFJQt2eWA9Sx3R5eF32WPn.html

  • @ujjawaltyagi3095
    @ujjawaltyagi3095 4 หลายเดือนก่อน

    why +1 i didn't get it ? isn't it like prefix sum? so we are basically storing sum of last two ele so why we need n+1 size instead of n ?

    • @nikoo28
      @nikoo28  3 หลายเดือนก่อน

      that is just to avoid index out of bounds exception

  • @sarthakjoshi21
    @sarthakjoshi21 ปีที่แล้ว

    op

  • @astra8072
    @astra8072 10 หลายเดือนก่อน

    so solution of this problem is basically a fibbonacci?

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน

      you are absolutely correct. Watch another fun video on fibonacci series: th-cam.com/video/WuMTCaM2pk8/w-d-xo.html

  • @sudippaudel1364
    @sudippaudel1364 5 หลายเดือนก่อน

    On How to understand and attack, how can (climb 1 stair from step 6 + climb 2 stairs from step 5) be translated to (number of ways to reach step 6 + number of ways to reach step 5)? HOW?

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      that is because you have to find the total number of ways.
      if you are able to reach step 6, then with 1 more stair you will reach step 7.
      so if you can reach step 6 in 10 ways, you can reach step 7 also by just climbing one more step. so all 10 ways you reached step 6 and then 1 more stair.
      so you are reaching step 7 in 10 ways.
      similarly, if you reach step 5 in 15 ways, then with just 2 more stairs you will reach step 7. so you can also reach step 7 in 15 ways.
      total ways = number of ways to reach step 6 + number of ways to reach step 5

    • @sudippaudel1364
      @sudippaudel1364 4 หลายเดือนก่อน

      Thank you @@nikoo28

  • @riyamalhotra6726
    @riyamalhotra6726 5 หลายเดือนก่อน

    I understood how to implement the code and I used recursion, like this:-
    public class Solution{
    public int climbStairs(int n) {
    return fib(n);
    }
    public int fib(int n){
    if(n

    • @brunosdm
      @brunosdm 5 หลายเดือนก่อน

      That will have a LOT of redundant method calls, but you can keep the recursive approach if you use memoization. Look that up.
      There's also videos explaining this solution with that approach.

    • @riyamalhotra6726
      @riyamalhotra6726 5 หลายเดือนก่อน

      @@brunosdm Oh! I looked up memoization and watched the explanation by hackerrank. Thanks!

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      absolutely correct, with memoization you can store your results..so you are not computing again and again.

  • @CostaKazistov
    @CostaKazistov 2 ปีที่แล้ว

    Confused.
    Isn't this LeetCode 70 (Climbing Stairs) and not 47 (Permutations II)?

    • @nikoo2805
      @nikoo2805 2 ปีที่แล้ว

      Thanks..this has been fixed :)

  • @gnanaprakashm843
    @gnanaprakashm843 4 หลายเดือนก่อน

    11:44 n minus 1 and n minus 2 😅😅

  • @anishbhandari4699
    @anishbhandari4699 หลายเดือนก่อน

    why array size is n+1

    • @nikoo28
      @nikoo28  29 วันที่ผ่านมา

      you need to start from 0

    • @anishbhandari4699
      @anishbhandari4699 24 วันที่ผ่านมา

      @@nikoo28 but you are not using 0th index right

  • @rickdutta3935
    @rickdutta3935 3 วันที่ผ่านมา

    This is just a fibonacci series answer.

    • @nikoo28
      @nikoo28  3 วันที่ผ่านมา

      but you need to reach over there first :)

    • @rickdutta3935
      @rickdutta3935 2 วันที่ผ่านมา

      @@nikoo28 Love your videos sir❤

  • @amitdahal9053
    @amitdahal9053 ปีที่แล้ว

    Thank you bhai...apke tasveer print karke main kal se pooja karunga

    • @nikoo28
      @nikoo28  ปีที่แล้ว

      thanks for the lovely feedback 🙏

  • @melk48111
    @melk48111 7 หลายเดือนก่อน

    you should make a udemy course and make $$

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน

      Haha..what course do you think I should make?

    • @melk48111
      @melk48111 6 หลายเดือนก่อน

      @@nikoo28 Udemy course on solving leetcode and another course on DSA

  • @TrueRDX
    @TrueRDX ปีที่แล้ว

    sub done 🤙

  • @TECHNICALMANedit
    @TECHNICALMANedit 9 หลายเดือนก่อน

    this method is right or wrong @NikhilLohia
    when i submit the code then I give's exceded time error
    if(n == 1 || n == 2){
    return n;
    }
    int recCall1 = climbStairs(n-1);
    int recCall2 = climbStairs(n-2);
    int smallCal = recCall1+recCall2;
    return smallCal;

    • @nikoo28
      @nikoo28  8 หลายเดือนก่อน

      try debugging with edge cases