Interval List Intersections | Leetcode

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • This video explains a very important interval based programming interview question which is to find all the intersecting intervals between two list of intervals. This is one of the most asked interview question. This may seem tricky at first glance but it is very simple once you draw some examples and apply your logic. I have shown 4 cases and one special case for this problem. using these cases and examples for each case, i have formulated the method to find the intersecting interval. I have shown dry run for an example and have finally explained the CODE at the end of the video. CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
    LinkedIn: / surya-pratap-kahar-47b...
    CODE LINK: gist.github.co...
    OTHER PROBLEMS:-
    Bitwise AND of numbers range : • Bitwise AND of numbers...
    Range minimum query: • Range minimum query | ...

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

  • @genctasbasi
    @genctasbasi 3 года назад +39

    I relax when I see the subject I didn't understand is covered by Tech Dose - it means I'm max 10 mins away getting it. Thanks.

  • @Cloud-577
    @Cloud-577 2 года назад +4

    I can't express enough how your explanations have helped us alot! you never jumped into the code instead you walk us through your thought process and guide us to the solution and that is exactly what we need. Thanks to you I can solve similar patterns without having to look up how to solve the problem.

  • @rakshith3547
    @rakshith3547 4 года назад +8

    man.. where were you all these days..i would request you to do more and more videos like these which would help thousands of job seekers and trust me you would be seriously blessed !

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

    Such an amazing explanation!!! Only you have the ability to explain a complex problem in a very simple way.

  • @bitqahdi6592
    @bitqahdi6592 4 года назад +3

    Your channel is unique because you make us understand the intuition behind the problem and logic.c

  • @shaswatdas6553
    @shaswatdas6553 4 года назад +1

    def intersect(a1, a2, b1, b2):
    '''
    a1-----1----a2
    b1---2---b2
    interval 2 should start before interval 1 ends
    and interval 2 should end only after interval 1 starts
    '''
    return b1

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

    I’m regular follower of your channel
    What amazes is the examples you take to explain the concept and which covers all the scenarios . How do you get those examples 😀😀 Kudos to you 👏👏

    • @techdose4u
      @techdose4u  4 года назад

      I just make that up on my own. I might miss some cases though 😅

  • @mehular0ra
    @mehular0ra 4 года назад +3

    I find this playlist really useful. The problems are explained really well!

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

    Man, Indians know how to explain shit! Thank you so much brother

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

    Super talented in simplifying concepts. Thank you!

  • @ABHINAVKUMAR-vh3ln
    @ABHINAVKUMAR-vh3ln 3 года назад +3

    Krishna bless you and your channel. You teaching is amazing. 😊😊

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

    you have the best channel for leetcode. you deserve the best.

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

    Very nice explanation sir .
    Thanku so much .
    Keep making these videos .

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

    Brilliant explanation. Intuitive yet confusing when you try for the first time :p

  • @vamsikrishna-uy9qp
    @vamsikrishna-uy9qp 4 года назад +2

    Great explanation. 🙌🙌

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

    Wow. a total breakdown! Indians are amazing!

  • @pavankumar.m1341
    @pavankumar.m1341 3 года назад +1

    Really well explained, i'm almost there but lost the word disjoint and was comparing 4 cases individually instead of simple approach like this

  • @rajeshbammidy180
    @rajeshbammidy180 4 года назад +1

    Java soln:github.com/RajeshAatrayan/InterviewPreparation/blob/master/src/Arrays/IntervalListIntersections.java

  • @sophiejhones3575
    @sophiejhones3575 4 года назад +1

    Excellent explanation, way better than the one provided on LeetCode.

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

    you expained it fing awesome bro

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

    Thanks!

  • @MP-ny3ep
    @MP-ny3ep 2 года назад +1

    very very good explanation

  • @bigboyshassen59
    @bigboyshassen59 26 дней назад

    thanks you for doing the needful sir

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

    Such a crisp explanation!!

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

    how do you know to increment by the second value?

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

    Very detailed and superb explanation! Thank you!

  • @aakashyadav6228
    @aakashyadav6228 4 года назад +1

    Very nice explanation. Loving it !

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

    Excellent

  • @amansarma417
    @amansarma417 4 года назад +1

    Your channel should grow it is providing amazing content

    • @techdose4u
      @techdose4u  4 года назад

      Yea it will. As soon as students find this channel 😅

    • @amansarma417
      @amansarma417 4 года назад

      @@techdose4u do a collaboration video what do you think? It may boost yout channel :)

  • @sandeepkumawat4982
    @sandeepkumawat4982 4 года назад +1

    Thanks you made it so so easy...Thanks a million

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

    Another amazing explanation!!!

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

    excellent work, thank you, sir.

  • @paragroy5359
    @paragroy5359 4 года назад +1

    Thanks for the explanation...

  • @ShubhamMahawar_Dancer_Actor
    @ShubhamMahawar_Dancer_Actor 4 года назад +1

    Again well explained

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

    very nice explanation Thankyou !!

  • @muhammedjack8303
    @muhammedjack8303 4 года назад +1

    Great explanation

  • @coderaky
    @coderaky 4 года назад +1

    Really great explanation.☕

  • @vasachisenjubean5944
    @vasachisenjubean5944 4 года назад +1

    dada kamon acho ? darun video banao tumi ! 😋

  • @antoniomartinez3429
    @antoniomartinez3429 4 года назад

    Is this sweep line?

  • @HarshGupta-if2xg
    @HarshGupta-if2xg 4 года назад +2

    how is to improve problem solving skills and prepare for product based companies. please tell

    • @techdose4u
      @techdose4u  4 года назад

      Keep practicing mock tests of leetcode.

  • @user-dp9gi1vg8r
    @user-dp9gi1vg8r Год назад

    very good, ty a lot

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

    great explanation..

  • @thiyagarajanr225
    @thiyagarajanr225 4 года назад +1

    You deserves honour !

  • @prabhatchanchal
    @prabhatchanchal 4 года назад +1

    Very nice explanation.
    But upload solutions after the day of question appear..

    • @techdose4u
      @techdose4u  4 года назад +3

      I understand the ethics. But for this challenge, solutions are available everywhere even on leetcode. This is just meant for fun. So, I do it everyday on the given day otherwise I will slack off.

  • @mkvikram4755
    @mkvikram4755 4 года назад +1

    thanks_.....

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

    i misunderstood the meaning of disjoint lmao, Thanks .

  • @meghabisht3144
    @meghabisht3144 4 года назад +1

    Really helpful!

  • @aniruddhachattopadhyay611
    @aniruddhachattopadhyay611 4 года назад

    Hi great video. Could you tell me the software you use to make this? You told me once you use Wacom tablet but what is this software/black notepad on which you write?

    • @techdose4u
      @techdose4u  4 года назад +1

      Wacom pro software as well. Combo from same company.

    • @aniruddhachattopadhyay611
      @aniruddhachattopadhyay611 4 года назад

      @@techdose4u thanks for the reply. Keep up the awesome work you are doing.

  • @retrogame3138
    @retrogame3138 4 года назад +1

    Bro mene coding do hafto s bnd kr di h pta nhi mn nhi lg rha kai baache kh rhe company nhi ane wali is baar college m college ka bhi kuch pdh nhi rha aur gta 5 online khelte rhta hu man m lgta h pdhna h par kitab uthane s darta hu aur revision krne s

    • @techdose4u
      @techdose4u  4 года назад

      Bro if you do this then you will regret when you come out of college. There will be more competition off-campus due to COVID. Now if you don't keep practicing and improving your skills, you will not rise above avg coder and you won't bag any job. That will be way more frustrating. So, think about the worst case scenario and use it as a motivation to prepare.

  • @dmsohel1335
    @dmsohel1335 4 года назад +1

    How to solve like this I am unable to solve this question please give any Tips to improve my problem solving skills

    • @techdose4u
      @techdose4u  4 года назад +1

      Just keep practicing and learning. There is no shortcut to it. When you can't solve. Just read editorial and code and understand why the logic works. Keep repeating this and you will see yourself solving questions on your own.

  • @erjang.4086
    @erjang.4086 4 года назад +2

    damn, i made a simple mistake in while - i put or vs and - it gave me out of bounds bug

    • @techdose4u
      @techdose4u  4 года назад

      :) I hope you did it now.

  • @035asadali8
    @035asadali8 2 года назад +1

    I think the same but not able to implement correctly 😢

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

      Try solving merge intervals :)

  • @HimanshuSingh-ob9qo
    @HimanshuSingh-ob9qo 4 года назад +1

    Leet code 56 plz solve this Ques and explain it

    • @techdose4u
      @techdose4u  4 года назад +1

      That is a little tricky problem. I just did it now 😅 You need to check for both end and start. Sort using start and maintain max(end). I don't think you understood here. I will do this problem video later 😅

  • @royalegamer4689
    @royalegamer4689 4 года назад +1

    Java code for this please

    • @techdose4u
      @techdose4u  4 года назад

      Couldn't code in java. Please get it from leetcode discussions.

  • @erjang.4086
    @erjang.4086 4 года назад +1

    i watch explanation but do code myself..

  • @abhijeetkumar2204
    @abhijeetkumar2204 4 года назад

    awesome explanation

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

    Thanks!