Search Insert Position (LeetCode 35) | Full solution with examples animations | Study Algorithms

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

КОМЕНТАРІ • 34

  • @tejasdonadkar352
    @tejasdonadkar352 Рік тому +4

    i think there is some error at timestamp 12:02
    high = mid -1
    and mid = 2 so high should be 2-1 = 1 but you wrote 2

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

      you are correct. I missed some values while doing the dry-run, but the code works for sure.

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

      yes i also found the same

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

    Thank you for teaching this. You are doing a great job.

  • @astronaut22
    @astronaut22 2 роки тому +1

    your teaching is good, I wached so many videos but dont understand about last part. But from your video I got that. keep it up and thanks

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

      Thanks for your kind comment :)

  • @shuwenzhao5126
    @shuwenzhao5126 2 роки тому +1

    Thanks! After watching many videos, finally find one I can understand....

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

      So happy you found it useful :)

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

    your explanations is the best sir
    you deserve more followers ♥♥♥♥♥♥♥♥♥♥♥
    Thanks for the video sir

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

      Thanks for the lovely comment.

  • @pulastyadas3351
    @pulastyadas3351 2 роки тому +1

    best explanation sir... i have ever followed. please keep continue

  • @pragmaticcoder6910
    @pragmaticcoder6910 6 місяців тому

    Good explanation. Please do more videos on Leet Code problems. Appreciate your efforts !

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

    I love your talking speed ❤😊 it really helps to understand the solution

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

      so happy to read this :)

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

    Best in buisness, Thanks NIkhil

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

    Thank you!

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

    Last approach gives TLE. time lime execced.
    Code :-
    class Solution:
    def searchInsert(self, nums: List[int], target: int) -> int:
    l = 0
    h = len(nums) - 1
    while(l target :
    h = mid -1
    else:
    l = mid +1
    return l

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

      try putting some print statements in your code to get the values of l, mid and h....that will help you. Most likely you are running into an infinite loop.

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

      @@nikoo28 yes it works. Thank you so much

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

    thank you🥰

  • @yelururao1
    @yelururao1 10 місяців тому

    greate explantion bro..

  • @xiaoyuli6008
    @xiaoyuli6008 2 роки тому +1

    Thanks.

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

    Awesome explanation 🙂

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

    thank u sir

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

    Thank you for the content

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

      Always welcome 😄

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

    this code at the end doesn't pass the leetcode pre tests though...

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

      Check the code in the video description :)

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

      @@nikoo28 yeahh my bad it works, my while() condition was while(low!=high) but you had low

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

    teacher we want at our colleges

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

    👌👌👌👌

  • @DeepakKumar-oz5ky
    @DeepakKumar-oz5ky 8 місяців тому

    Thank u sir

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

      So nice of you