Merge intervals

Поделиться
HTML-код
  • Опубликовано: 25 авг 2024
  • Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

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

  • @vimalrajj542
    @vimalrajj542 Год назад +3

    I refered many videos for this problem, but this solution was excellent and completely understood- thankyou

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

    thank you so much for your beautiful explanation , even striver was not able to convinced me

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

    One of the most descriptive solution......thankyou !!!

  • @rebechkah
    @rebechkah Год назад +2

    Thank you so much!! Got stuck on this because I was trying to compare within the intervals instead of what was already in the answer vector :)

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

      same now i will remember incase of merging how it has to be proceeded

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

    Thanks for this explanation.
    I solved with the reverse approach (by sorting with end time).
    Now i have understanding of both sides.

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

    It really makes my interest back into dsa with ur every video✨

  • @foodcourt6810
    @foodcourt6810 2 года назад +4

    Understood. Mam very thank you for using simple for loop over iterators ,because all youtube videos are explained in iterators. You're code is very much understandable than other videos. Please write simple code in future videos also. Also I'm very grateful for keeping this video in english. Please maintain in english ,your communication is good!

  • @tausifahmad2007
    @tausifahmad2007 2 месяца назад

    Well and concised explanation ... Great work Alisha 👏👏 keep it up.

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

    Clean and up to the point explanation!!

  • @hsg15
    @hsg15 11 месяцев назад

    Didi, You are such an amazing person . You make things so crisp and clear 😊🌸

  • @HARSHVARDHAN-zy5fd
    @HARSHVARDHAN-zy5fd 2 года назад

    Your video explanation is one of the best...keep doing mam++;

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

    thank you so much mam . your explaination is very easy to understand.

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

    arey didi kya padati ho aap maza aagya

  • @manitejach5608
    @manitejach5608 2 месяца назад

    Thank you so much

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

    best explanation to this question thank you

  • @AkashGupta-hq6nj
    @AkashGupta-hq6nj 2 года назад +11

    mam can u please share time and space complexity also in each video ? It will help analyzing problem better ,Thanks

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

      i think it is O(n) since we are going to visit every interval once, and the number of elements inside the interval is fixed

    • @vishalpanchal2343
      @vishalpanchal2343 Год назад +2

      @@rebechkah Here Time complexity is Nlog(N) because here we are using sort function.

  • @Rizwankhan-ts3gk
    @Rizwankhan-ts3gk Год назад

    thanks sister , really so much helpful

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

    Thanks Alisha for making vidios....

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

    ur explanation is too good

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

    very nicely explained

  • @tarun-prakash
    @tarun-prakash Год назад +1

    thanks akka

  • @HarendraKumar-yr4gt
    @HarendraKumar-yr4gt 2 года назад +2

    Nice ma'am

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

    Can you please explain why you did not add this line since v[1] gets updated so v[0] should also be updated as v[0] = min(v[0], intervals[i][0]); ????

  • @RohitKumar-dy2gc
    @RohitKumar-dy2gc Год назад

    finally seems so easy to do

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

    Could you please make a video about your coding journey!!! from first programming to microsoft.
    And also for core branch student what are the fundamental computer sub(like OS, DBMS, OOPS etc) that we should study for placement ???

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

    thanks mam🧡🧡

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

    why we are taking &v in line no.20 instead of only v ?

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

    Can u please make a video on "Maximum area of triangle" question on interviewbit? I'm not understanding that

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

    If I am using ans.front() in line 20,its giving error . Why?

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

      We need to take ans.back() to get the previous interval , so that we can compare previous and current interval .

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

    8:26

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

    Didi nahi samaj rha hai mujhe, my vector concept is weak

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

    maam what is your full name , so that I get connected with you on linkedIn