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

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ส.ค. 2024

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

  • @Princyy
    @Princyy 20 วันที่ผ่านมา

    Best in buisness, Thanks NIkhil

  • @tejasdonadkar352
    @tejasdonadkar352 11 หลายเดือนก่อน +3

    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  10 หลายเดือนก่อน

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

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

      yes i also found the same

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

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

  • @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.

  • @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 :)

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

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

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

      so happy to read this :)

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

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

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

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

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

    Thank you!

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

    thank you🥰

  • @DeepakKumar-oz5ky
    @DeepakKumar-oz5ky 8 หลายเดือนก่อน

    Thank u sir

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

      So nice of you

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

    Thanks.

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

    Awesome explanation 🙂

  • @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

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

    greate explantion bro..

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

    Thank you for the content

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

      Always welcome 😄

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

    teacher we want at our colleges

  • @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

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

    👌👌👌👌

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

    thank u sir