First and Last Position of Element Sorted Array (LeetCode 34) | Full Solution | Study Algorithms

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 27

  • @MVCSPratyushKumarShekhar
    @MVCSPratyushKumarShekhar 3 роки тому +11

    This is really one of the most underrated video on UA-cam. The way you have explained this concept is awesome. Please do continue this good work. Everyone can be a good programmer/coder but everyone can't be a good teacher.

    • @nikoo28
      @nikoo28  3 роки тому +3

      Thanks for all the love and support

  • @HarshChauhan-ur4jy
    @HarshChauhan-ur4jy 2 місяці тому +1

    I watched two explanations before this but couldn’t understand them. However, your teaching method was awesome, and I was able to write the code on my own right after understanding your solution. Thank you!

  • @bhavyakarma8678
    @bhavyakarma8678 11 днів тому

    the best , easy and good approach for the problem thanku so much nikhil for this

  • @saitejanedunoori5451
    @saitejanedunoori5451 7 місяців тому +2

    I just started learning DSA when i am unable to solve leet code problem i first search in your youtube channel for a solution, In my opinion you are best at explain algorithms, Keep on going .

  • @Sridevikrish21
    @Sridevikrish21 4 місяці тому +1

    the way of teaching makes us to solve the more problems

  • @krishnenduroy3673
    @krishnenduroy3673 Місяць тому

    It was super smooth and easy to understand. Thanks 👍

  • @aarzoo2302
    @aarzoo2302 Рік тому +1

    u explain everything and it was quite easy to understand, thankyouuu

  • @siva_avinash_
    @siva_avinash_ Рік тому

    The way you make things clear is superr

  • @mikedelta658
    @mikedelta658 8 місяців тому +1

    Fantastic and clear explanation. Thank you!

    • @nikoo28
      @nikoo28  7 місяців тому

      You're very welcome!

  • @atifraza9960
    @atifraza9960 2 роки тому

    The way of your explanation excellent 👏👏👏

  • @sohitmaurya4782
    @sohitmaurya4782 3 роки тому +1

    Great Explanation👏👏👏

  • @ashishsonii
    @ashishsonii 7 днів тому

    please upload more dsa question.. i only want to learn from you

  • @ashishsonii
    @ashishsonii 7 днів тому

    please upload more dsa question.. i only want to learn from you

  • @ashishsonii
    @ashishsonii 7 днів тому

    please upload more dsa question.. i only want to learn from you

  • @rambhaktuchihaobito7987
    @rambhaktuchihaobito7987 2 місяці тому

    Thank you sir ❤

  • @casstansa
    @casstansa 3 місяці тому

    brilliant🤩

  • @_shezzy
    @_shezzy 5 місяців тому

    Will this solution work if input is [1,2,3] and target is 2

  • @madhumithraravi9087
    @madhumithraravi9087 3 роки тому

    What happens if the first and the last index both exists in left bound? or right bound? this approach will return last index or first index as -1 right?

    • @nikoo28
      @nikoo28  3 роки тому +2

      Let’s say both first and last exist in the left bound.
      When you first divide the array, you will not find the element in the middle, so following a binary search algorithm you will look in the left half. This will be your new array now.
      So you will again find the first and last index in the left half.
      Try out a test case on your own and you will understand it better :)

    • @madhumithraravi9087
      @madhumithraravi9087 3 роки тому

      @@nikoo28 Kind of recursive

    • @nikoo28
      @nikoo28  3 роки тому

      Yes indeed…this is a recursive solution. Just like binary search.

    • @madhumithraravi9087
      @madhumithraravi9087 3 роки тому

      @@nikoo28 thank you

    • @fero___3005
      @fero___3005 2 роки тому

      @@nikoo28 when low < high breaks the loop and the low value = 3 but the index value is still 2 how will you get 3 as output plz explain sir

  • @KUNALPRAJAPATI-fi3jy
    @KUNALPRAJAPATI-fi3jy 6 місяців тому

    just love the explanation