Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction

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

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

  • @BackToBackSWE
    @BackToBackSWE  5 ปีที่แล้ว +23

    Table of Contents:
    The Problem Introduction (Variant 1) 0:00 - 1:51
    Jumping To The Brute Force 1:51 - 2:52
    Optimizing Our Search 2:52 - 4:14
    We Need To Notice Something... 4:14 - 5:49
    The Data Does Not Dictate How We Interpret It 5:49 - 7:28
    Establishing Our Mapping System 7:28 - 11:03
    Executing The Binary Search 11:03 - 15:10
    Runtime of Our Binary Search 15:10 - 15:45
    The Problem Introduction (Variant 2) 15:45 - 16:43
    Jumping To The Brute Force 16:43 - 17:15
    The #1 Key To Search Problems 17:15 - 19:08
    Defining Our Fundamental Decision Operation 19:08 - 20:57
    Searching For Places To Start Our Search 20:57 - 22:48
    Search Example #1 (Bottom Left Starting Point) 22:48 - 24:37
    Search Example #2 (Top Right Starting Point) 24:37 - 25:38
    What Just Happened 25:38 - 26:19
    Analyzing Our Incremental Approach 26:19 - 28:34
    Wrap Up 28:34 - 29:11
    The code for both variants is in the description, fully commented for understanding purposes.

    • @JulianBG
      @JulianBG 4 ปีที่แล้ว

      At th-cam.com/video/FOa55B9Ikfg/w-d-xo.html the complexity is between O(n) and O(log(n)), because the real "n" is n*m and using binary search on each row will be faster than O(n), where n are all numbers.

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

      I don't remember this video well enough to have a comment

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

      Hi! I can't seem to locate the code

  • @gradientO
    @gradientO ปีที่แล้ว +4

    As a beginner, this channel is such a goldmine. The way you explain complex topics in a easy intuitive way is really amazing wow man

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

      Thank you! Please enjoy a special code from us - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=madmax 🎉

  • @yusefmustafa2603
    @yusefmustafa2603 5 ปีที่แล้ว +79

    Just got my FB swe intern offer yesterday! Your vids help out a ton man.

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

      I will have my FB interview next week. Is it ok if I send a message to you?

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

      @@darod6098 go for it

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

      @@yusefmustafa2603 youtu.be/addme/-QH9AgDdeiTXzl3HYqC3bGJdfw4zYQ

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +2

      nice, good job :) keep it up

    • @satyajitkamble1646
      @satyajitkamble1646 5 ปีที่แล้ว

      Hey Yusef! Can I connect with you!? I am applying to FB as well within 3 weeks and i need some guidance!

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

    Haven't commented on a coding explanation video before but this is actually the best channel ever. I was struggling so hard with this problem until this video and this made everything seem so easy. Thank you so much, please never stop creating this amazing content.

  • @liyingyin9845
    @liyingyin9845 5 ปีที่แล้ว +2

    Oh man!!! You are awesome!!! Lots people can write perfect code but not many of them can express their ideas and especially make others understand the code and why write the code this way.. but you MADE IT!!!! "Reducing the search space." You are genius!!! Thanks for all your hard working!!!

  • @joshhwb
    @joshhwb 5 ปีที่แล้ว +37

    Astounded this has < 10k views. By far the best content on these topics I've come across. Keep grinding Ben!

  • @ishanshah3309
    @ishanshah3309 4 ปีที่แล้ว +7

    He has a magic of explaining dsa problems very well.

  • @ravipatel-xu5qi
    @ravipatel-xu5qi 3 ปีที่แล้ว

    It took so much time for me to find someone on youtube like you who can explain in so much depth. There are lots of channels who explains the direct solutions but those are not really helping. You are the real hero who helps us to build the correct logic.
    Thank you so much. Keep making such good videos.

  • @kharinskiyalexey7409
    @kharinskiyalexey7409 5 ปีที่แล้ว +14

    "Reducing the search space..." - such a nice insight! Thanks man your lessons made me more confident.

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

    Just stumbled upon this video and have to say youre one of the best teachers for computer science I have seen.

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

      Thank you, glad you liked it 😀
      Do check out backtobackswe.com/platform/content
      and please recommend us to your family and friends 😀

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

    dude I have read many tutorials and discussions on this question but no one has actually explained why we choose top right or bottom left like you did. you're just awesome man

  • @farizma
    @farizma 3 ปีที่แล้ว

    This channel has best explainations, the way he approaches, starts from brute-force, slowly move to optimal with clearly explaining each move, makes coding feel very easy. Love the contents. plz dont't stop, keep making the videos, of-course this channel can become the world's largest swe resource.

  • @gssnhimabindu8831
    @gssnhimabindu8831 4 ปีที่แล้ว +11

    Whenever I can't understand any question and see that you have done a video on it already .. I feel so relieved!! Thanks for such awesome videos!
    Could you also make videos on how should we present the solution to questions asked in coding interviews ?

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

      great - sure - I can't due to time constraints but we have backtobackswe.com (paywall)

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

      Same, makes learning fun!

  • @doobydoobler
    @doobydoobler 5 ปีที่แล้ว +2

    Keep doing what you're doing... please. You're so clear on explanations and without showing me code, I'm understanding the concepts of these questions so much more now. I wish I stumbled on these sooner. I'm actively applying right now as a graduating senior. I am not having much luck landing interviews due in part to my lack of an internship... but I'm hoping going through these practices will help me slam dunk whatever interview comes my way some day. Thank you!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +2

      Hahahaha. Yes. This project is still very much active (as long as people demonstrate interest). We will continue to expand.

  • @aprajitajha9195
    @aprajitajha9195 5 ปีที่แล้ว +7

    The solution feels effortless once I have been through your videos! Thanks so much! :)

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

    Carry on, bro. Your algo video is really different and effective than the other guys on the youtube. Others just give the solution but you are the one who tries to explain the reasons behind the solution.

  • @Hasansaid51
    @Hasansaid51 4 ปีที่แล้ว +2

    I’m glad I found your TH-cam channel last night cuz I’ve been stuck on this problem for a while lol. 🙏🏾

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

    The most beautiful and all-encompassing explanation of this problem solving approach on the internet! :) Your videos help a lot! Please keep up the good work Ben!

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

    One of the best explanations or walkthroughs I have ever seen for any problem.

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

      Thank you, glad you liked it 😀
      Do check out backtobackswe.com/platform/content
      and please recommend us to your family and friends 😀

  • @wl7497
    @wl7497 5 ปีที่แล้ว +3

    Of course it's helpful, you can influence lots of people and they benefited from your instructions. Keep it up, bro!

  • @khssameernew
    @khssameernew 4 ปีที่แล้ว +2

    Sir,
    Your videos are AWESOME , nothing can be better than this!!! ...
    could you please do some videos on system design problems.....

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      yeah, we will find someone for that

  • @abdoulbarry8111
    @abdoulbarry8111 3 ปีที่แล้ว

    The king is so good at this I wonder where he gets his knowledge!!! I swear this is the best class anyone can take

  • @raninagare7678
    @raninagare7678 5 ปีที่แล้ว +2

    You are a really awesome man:). I was afraid of these problems before, but once you explained the logic, I am so much confident now. If you continue to teach like this, no one can stop you from being the world's largest and best software engineering resource.

  • @michalbelay8540
    @michalbelay8540 3 ปีที่แล้ว

    The best algorithms guy in youtube, thank you!

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

    This is spectacular! So clear and concise - bonus it covers the variant too!

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

    I don't know why I didn't find your channel sooner. Thank you so much for this explanation!!

  • @nastusalmander
    @nastusalmander 5 ปีที่แล้ว +2

    Hey, I've been watching your videos and they're very helpful for studying for interviews. You do some really clever things that I won't have thought of and I appreciated opening my perspective. Granted these problems weren't be done while I'm working at a SWE job but to get that job these types of videos are needed. Much love and best wishes in the future

  • @RahulVerma-fz2jf
    @RahulVerma-fz2jf 4 ปีที่แล้ว +1

    Awesome !!. I think, today I understood both the approaches in depth. Won't forget now. :). Keep up the good work.

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

    I've literally stopped doing office work this corona season. I log in, finish stand-up and come here :P This is fascinating stuff !!

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

    Really appreciate how much effort this man takes to explain everything easily

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

    Valuable tutorial, thanks! Where's the coding solution? It was mentioned in the description but I didn't find it.

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

    Best explanation I ever heard. You taught to help us build mental model. You are awesome

  • @大盗江南
    @大盗江南 4 ปีที่แล้ว +1

    This video is the most genius video ever! Super super good buddy!! we love u!!!

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      no love u go internet

    • @大盗江南
      @大盗江南 4 ปีที่แล้ว

      @@BackToBackSWE what r u talking about buddy 🤣

  • @rishbhardwaj1431
    @rishbhardwaj1431 5 ปีที่แล้ว +3

    The last bit is genius! I figured I can't reduce my search space when I started at the top left, but it just didn't strike me that the top right or bottom left would work.

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

    I like your emphasis on the fundamentals. The fundamentals!

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

      Thank you, glad you liked it 😀
      Do check out backtobackswe.com/platform/content
      and please recommend us to your family and friends 😀

  • @JG-zu6nq
    @JG-zu6nq 5 ปีที่แล้ว +4

    Been watching your vids and got my Amazon interview next week. Hopefully goes well!

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

      2 people messaged me and said they got in Amazon after peeping the vids...you got this :)

    • @JG-zu6nq
      @JG-zu6nq 5 ปีที่แล้ว +3

      @@BackToBackSWE Just got my offer. Thanks a bunch man, keep up the great work!

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

      @@JG-zu6nq nice, good luck at your new job!

  • @spk9434
    @spk9434 5 ปีที่แล้ว +3

    awesome as always. Best spent 29 minutes of the day ! Do a video on spiral matrix.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +3

      hahahaha, sure. And I only take suggestions from Patrons who support the project now. To be fair to those paying to support the project

  • @piyushmajgawali1611
    @piyushmajgawali1611 5 ปีที่แล้ว +23

    The second variant was asked in Amazon coding test

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

    This channel will be real big one day.

  • @derilraju2106
    @derilraju2106 5 ปีที่แล้ว +2

    You deserve lot more views on your videos!

  • @remyb9937
    @remyb9937 5 ปีที่แล้ว +2

    Hey what's up! I actually just got past the HC at Google! I spent about 5 weeks almost exclusively studying your videos (and Tushar Roy's along with some others) and doing Leetcode problems (I actually had that much time), and went onto my onsite and did pretty well. I pulled off the design interview, but would love to see a video or two on Software Design Interviews. Thanks again!

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

      NICE! Wait...so you got hired? Or is there another step past hiring committee? I'm not fully familiar with the final steps.
      Also, check back in a little...I have plans...I'm launching a Patreon and have more announcements.

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

      @@BackToBackSWE HC is pretty much hired they told me. They are just looking for a team placement. I think it varies from person to person though whether HC is the last step, but they indicated for me it was the last as far as problem s solving is concerned. Anywho, I'm still super into your stuff and will keep following it. I think I'm going to do competetivel coding as a hobby! You've really inspired me!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      @@remyb9937 Nice! I was considering that route (competitive programming), but I don't think I'd be willing to dedicate the time to get really good...and I like talking better haha.
      Connect with me on LinkedIn if you want, let's stay in touch.

  • @adarshjadhav8877
    @adarshjadhav8877 4 ปีที่แล้ว

    Hats off to ur explanation brother..
    Beginners look for quick solutions and might skip ur vedio.. but believe me eventually they will follow u to learn the thought processs.....

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

    Excellent elaboration! It is systematic and a easy to climb learning curve.

  • @ramjiintrouble
    @ramjiintrouble 3 ปีที่แล้ว

    You are just amazing Ben ! Thanks for covering both the variants !

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

    Hi Ben, please keep going on, you will change the industry soon. Thank you very much for your efforts.

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

    Wow! Thank you for the easier method of solving the variant... I think at one point I understood the more complicated solution... but I have already forgot... and there is no way its going to come to me during high pressure interview... This method is very intuitive!

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

    No one could explain it better than you

  • @michaelhernandez5478
    @michaelhernandez5478 3 ปีที่แล้ว

    Hey, really great explanation on exploiting the properties of a 2d matrix. One part I couldn't follow was at 14:21 , you calculate the midpoint at row 1 col 2. And the target value is greater than the midpoint. Did you mean to say "go to the right"?

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

    Amazing!. You explained the detail thought process.

  • @justpk5773
    @justpk5773 4 ปีที่แล้ว +3

    As row heads are sorted as well, why dont u do binary search on Row heads to find out which exact row to search & then within that row u can do binary search. Assuming m rows & n columns, it can be done in O(log m) + O(log n)

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      im not sure I dont remember this problem's details too well

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

    YOU ARE GOD, buddy this channel is very very very impressive and your explanation skills are just over the top, i am sure i will see you in Google someday :)

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

    you are great man , really doing good job , i paused the video in between to comment this

  • @ekejma
    @ekejma 3 ปีที่แล้ว

    Another great video even if I know the answer there is always something I missed or under thought in terms of a deeper exploration of the problem space.

  • @JacobAbraham-twozerosix
    @JacobAbraham-twozerosix 5 ปีที่แล้ว +1

    Nice.... Really enjoying this... Your presentation has improved... Keep up the good work.

  • @briarsmith8241
    @briarsmith8241 4 ปีที่แล้ว

    Something that everyone seems to be missing that makes this problem a lot easier is that arrays and vectors are contiguous in memory. This means that you can just increment, so if there is 4 columns and you are at row 1, the index 4 (the start of the second row) can be accessed by simply doing array[4]. Just continue this from 0 to n*m. Much easier than messing around with the modulus and division.

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

    You are doing great man. Keep it up!

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

    always helpful in my LeetCode learning!!!!!!!!!!!!!!!!!!!!!!!

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      Great to hear - we want to create something better than Leetcode one day

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

    Subscribed in first 10 seconds. Amazing content.

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

      Thanks, appreciate it 😄 We'd love for you to check out our Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉

  • @BarneyBing883
    @BarneyBing883 5 ปีที่แล้ว

    Hey, thanks for the video. I came up with another solution that runs in log(m) + log(n) time. Don't know whether that's faster than log(mn).
    So the solution is -
    1. We know each row is sorted.
    2. We know each row is "contiguously" sorted, so that the last element of each row is less than or equal to the first element of the next row.
    3. That means the first column would also be sorted.
    4. So we do a binary search on just the first column. If the element is found, good; else, we can at least locate the row where the element would be. We just need to terminate our binary search when we get to a row where the first element is less than the element, and the next row's first element is greater than the element. This is log(m).
    5. Then just do a binary search on this row. That's log(n).
    Think this works, but I'm not sure if that's faster than log(mn).

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

      Yes, that sounds like a valid solution and is logarithmic.
      Edit (revising original answer): log(m) + log(n) is the same as log(m*n) by logarithm rules. Either way, both approaches are asymptotically the same.

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

      @@BackToBackSWE Thanks! Your videos are a boon, by the way.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      @@BarneyBing883 nice

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

    Your videos are really awesome!
    Thanks for helping!

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

    i just saw it again. Do you think that the most optimal solution (the one that is so lengthy in CTCI) would be required to pass an intern internview?
    Cheers :)

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

    great explanation! very clear

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

      thankls

    • @islamkadri7159
      @islamkadri7159 4 ปีที่แล้ว

      @@BackToBackSWE just when i thought you had a bot making all these replies. lol

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

    Thanks for the videos as always . You’re the man

  • @LeoKnight1986
    @LeoKnight1986 5 ปีที่แล้ว

    Great explanation, thanks so much. But why it is " row: i / totalColumns; col: i % totalColumns" at 8:17 of this video while " row in 2D matrix: 1DIndex / totalRows
    ; col in 2D matrix: 1DIndex % totalColumns" in github ? I'm so confused.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      may be a mistake not sure, I think I saw a pr about this. maybe I merged a bad pr? no idea, I don't tend to the code base too well because I don't have the time. If you want to send a pr I'll merge it, otherwise I'm unable to look into this

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

      @@BackToBackSWE ok, I'll send the pr later.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      @@LeoKnight1986 thanks!

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

    Hi!
    What if I have scenario-2 matrix where I need to count the appearances of an X I am looking for?
    Matrix kind of like that:
    1 4 8
    2 8 11
    8 10 15
    I need to find how may times, 8 appears in the matrix.
    Thanks!

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      I'm not sure - I don't remember this video much

    • @JakeStaf87
      @JakeStaf87 4 ปีที่แล้ว

      Back To Back SWE thanks I found a solution !

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

    Awesome explanation!

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

    Thanks for the great explanation as always!

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

    Your explanation is amazing. Thanks

  • @farshadsaberi2740
    @farshadsaberi2740 3 ปีที่แล้ว

    Great explanation! Thank you!

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

    such an informative video. thanks boss

  • @Messirobben047
    @Messirobben047 3 ปีที่แล้ว

    God-level explanation!

  • @Debugging-Life-f4f
    @Debugging-Life-f4f 3 ปีที่แล้ว

    You are the Best Sir ! Thank you so much

  • @ЏонМастерман
    @ЏонМастерман 5 ปีที่แล้ว +1

    Managed to do this one in O(n). :d 100% less memory than other users, but faster only than 5% of ppl on leetcode.
    Actually, I did the Search a 2D Matrix II.

  • @abhinaygupta
    @abhinaygupta 3 ปีที่แล้ว

    Brilliant Explaination 👍🏻

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

    Excellent content!

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

    Amazing!! Can't be better.

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

    Thanks a lot for your teaching!

  • @shreyshekhar6419
    @shreyshekhar6419 3 ปีที่แล้ว

    12:03 We need to do our Math: opens the marker cap. Nah the animation guy will take care of it XD. Btw awesome video bud as always!

  • @sidhant4674
    @sidhant4674 5 ปีที่แล้ว +2

    Great explanation man!

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

    I've really liked your way of explaining
    It would be of great help to me if you create videos on system design
    Please

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +2

      I will eventually, I am not an expert in that so I need to learn first before I can authoritatively teach that. It is in high demand amongst people.

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

    Grt grt grt video.. Grt thinking power

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

    Thank you so much for this video!

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

    Thank you!

  • @yaseengousesamudri9390
    @yaseengousesamudri9390 3 ปีที่แล้ว

    For the solution to the 1st variant: Why can't we find the required row in O(log(m)) and then search that row in O(log(n)) to make the total time complexity to search an element be O( log(m) + log(n) ) which is smaller that O(log(mn)) ?

  • @VishalKumar-kr9me
    @VishalKumar-kr9me 4 ปีที่แล้ว +1

    Love you man...You are the best

  • @ZevaSuper
    @ZevaSuper 3 ปีที่แล้ว

    I would say it is about where we can build heuristic function (11 corners) and where we can not(other corners). And everything goes similar to A*

  • @DonTaldo
    @DonTaldo 3 ปีที่แล้ว

    As always, awesome content

  • @Official-tk3nc
    @Official-tk3nc 4 ปีที่แล้ว +2

    best explanation ever seen:)

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

    I wish I could like the video more than once!

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

    super explaination!!! keep up the work, thanks :-)

  • @sagarshah8390
    @sagarshah8390 4 ปีที่แล้ว

    beautiful explanation

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

    Awesome!
    Really appreciate it bro!

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

    really enjoy this video!

  • @princekumarsingh5345
    @princekumarsingh5345 5 ปีที่แล้ว

    very detailed lecture. Thanks for the content

  • @walterwhite6499
    @walterwhite6499 4 ปีที่แล้ว +2

    Let's make it more challenging. In the second variant, instead of directly searching for an element, find the kth smallest/largest element.

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

      ok

    • @Hav0c1000
      @Hav0c1000 4 ปีที่แล้ว

      Sounds like basic chemistry, bro

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

    Awesome explanation. btw the code link is not working

  • @egor.okhterov
    @egor.okhterov 3 ปีที่แล้ว

    For the second problem we could binary search each row or each column and get O(n * log m).
    We will definitely win in a situation if we have 1 x n or n x 1 matrix.

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

    where can i see the code?

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      The repository is deprecated - we only maintain backtobackswe.com now.

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

    AWESOME! Thank you. Just subscribed ;)

  • @SigalGraboys
    @SigalGraboys 3 ปีที่แล้ว

    really helpful!!! thank you