632. Smallest Range Covering Elements from K Lists | LEETCODE 632 | LEETCODE HARD | CODE EXPLAINER

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 34

  • @manimtirkey861
    @manimtirkey861 12 дней назад

    Nice work. You can optimise a little bit by removing redundant code.
    just check "total == diff" once and perform the "while total == diff" until you get the best j and after you break you can check only once if(a[i].first-a[j].first+1

  • @abhilakshmaheshwari9360
    @abhilakshmaheshwari9360 2 года назад +2

    A diff perspective!! Thanks a lot :)

  • @Negijicoder
    @Negijicoder 5 месяцев назад

    by taking the hint combining them... i'm able to do it..thx

  • @abhishekgoyal7765
    @abhishekgoyal7765 12 дней назад

    Well explained, but I think the code can be reduced and improved

  • @sanskarkumar7984
    @sanskarkumar7984 3 года назад +2

    Great Video Bhaiya. Just Love Your explanation. 🥰🥰
    If possible Could You please bring a video on How to prepare for placements at this stage 🥺🥺

    • @nanda_8
      @nanda_8 2 года назад +1

      It's been 1 year...
      What is going on now?

    • @sanskarkumar7984
      @sanskarkumar7984 2 года назад

      @@nanda_8 Placed at A Product Based Company with a Decent Salary 😇

    • @nanda_8
      @nanda_8 2 года назад

      @@sanskarkumar7984 that's great 😃😃
      So happy for you 😁

    • @sanskarkumar7984
      @sanskarkumar7984 2 года назад

      @@nanda_8 Thanks a Lot 😇

  • @prateekvarshney2280
    @prateekvarshney2280 3 года назад

    Great solution. Do you come up with such approach and implementation by your own.

  • @qwfqefqedytdf4134
    @qwfqefqedytdf4134 3 года назад

    Good work bro, I think you can remove 1st IF condition(total==diff), it'll give same result

  • @JEAnandkumar
    @JEAnandkumar 3 года назад

    Amazing problem and solution!

  • @voldemort576
    @voldemort576 3 года назад +2

    Time - O(n*k*log(n*k)) ???
    Space - O(n*k)?

    • @girikgarg1268
      @girikgarg1268 3 года назад

      How did you find the time complexity?

    • @nanda_8
      @nanda_8 2 года назад

      We can't really say it's*k as size of k changes

  • @girikgarg1268
    @girikgarg1268 3 года назад

    What will be the time complexity of this approach?

  • @tathagatnegi5923
    @tathagatnegi5923 3 года назад

    Thanks...this was a very good explanation 👍

  • @MIRAZIB
    @MIRAZIB Год назад

    Kindly verify my time complexity analysis:
    Here at max:
    k = nums.length = 3500
    ni = nums[ i ].length = 50:
    let,
    N = k * ni = total number of elements in whole nums.
    O(N) -> to make 1 array.
    O( Nlog(N) ) -> to sort whole array.
    O(N) = whole array size -> for while/for loop iteration.
    TC: O(N)+ O( Nlog(N) ) +O(N) => O( Nlog(N) )
    Space complexity:
    O(N) = for whole array.
    O(k) = map size.
    SC: O(N + K).
    Correct me if I'm wrong 🙂🙂.

    • @mruduladdipalli5417
      @mruduladdipalli5417 Год назад +1

      Space Complexity to be considered as O(N), k will always be smaller than N

  • @annugoyal6242
    @annugoyal6242 Год назад

    Bro can you please share link of the code?

  • @rajaspaunikar9695
    @rajaspaunikar9695 2 года назад +2

    Where is the code link broooooooo

  • @inspired_enough_to_grow_up
    @inspired_enough_to_grow_up 2 года назад

    man you are just amazing
    why no more videos now?

    • @codeExplainer
      @codeExplainer  2 года назад

      was pre occupied with my course , but it is almost completed. Will be back on youtube with more force

    • @Prashantkumar-pn6qq
      @Prashantkumar-pn6qq 2 года назад

      @@codeExplainer which course?

  • @letsdoyoga7
    @letsdoyoga7 6 месяцев назад

    What about 9,10
    it is smallest range

  • @dibyendubar8920
    @dibyendubar8920 3 года назад +1

    The background music is irritating