Leetcode Biweekly Contest 98 || Screencast + Commentary || Finishing in 32 mins

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 13

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

    God bhai

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

    can I use ur segment tree code in contests? And also please share it.

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

    Goat

  • @sahilanand30
    @sahilanand30 Рік тому +3

    Legend

  • @ashish1284
    @ashish1284 Рік тому +6

    Your videos teach a lot to me.
    It's not just solution of problem.
    I get to know how you think, how you correct logic when not working.
    Please keep uploading videos.
    Thanks a lot Sir.

    • @Harisamsharma
      @Harisamsharma  Рік тому +2

      Glad to hear it :)

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

      @@Harisamsharma Yes indeed, there are tons of videos about the solutions and all, but getting to know how a CM thinks during contest, how calm he is, how he handles when going in the right direction . Very helpful...keep it up

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

    This is what happens when rangey stops his poetry in between contest 😂

  • @242deepak
    @242deepak Рік тому +2

    what is the intuition behind soln for 2nd?

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

      same doubt like why we have to take that difference

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

      ?

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

      @@sagemode6090 we want the minimum value of score, i.e. (low + high), low can be easily calculated to be 0. so we only want to minimize high. Eg.- [1,2,3,4,5] in this high will be 4. so if we want to minimize high, we need to change the [n-1] with [2] or [n-2] with [1] or [n-3] with [0]. Its actually pretty easy if u just look at it.

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

      we want the minimum of (min + high). we can replace any two values. so let's make cases here -
      1) we replace the first and the last values i.e. we replace nums[0] with nums[1] and nums[n-1] with nums[n-2] i.e. the difference = nums[n-2] - nums[1]
      2) we replace the first two values i.e. we replace nums[0] with nums[2] and nums[1] with nums[2] as well i.e. difference = nums[n-1] - nums[2]
      2) we replace the last two values i.e. we replace nums[n-1] with nums[n-3] and nums[n-2] with nums[n-3] as well i.e. difference = nums[n-3] - nums[0
      we return the minimum of above