Solve Coding Interview Backtracking Problems - Crash Course

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 106

  • @7Ibby
    @7Ibby 2 роки тому +205

    This feels more like watching a leetcode solution video. I'm not really getting what the logic and understanding of how to go about backtracking problems is. I don't know if I'm the only one, but it seems there needs to be some prior knowledge of backtracking algorithms to follow this video.

    • @DWEthiopia
      @DWEthiopia 2 роки тому +7

      Recursion is the foundation for backtracking. If you have any flaws in understanding recursion, I would start there.

    • @where3639
      @where3639 2 роки тому +1

      @Siraj Haq By state she meant the position of the queens in the chessboard. She represented state in her code using a list where each element in the list is a queen; the position/index of each element in the list represents the row that the queen is placed in, and the value of the element is the column the queen is placed in. So,
      [2,0,1,3] would mean the 1st queen is placed in row = 0 column = 2, the 2nd queen is placed in row =1 column = 0 and so on.

    • @where3639
      @where3639 2 роки тому +1

      @Siraj Haq Yes, you want to think of the state like a snapshot of the chessboard which gets updated with each recursive call. Representing state in a 1 dimensional size array would be the most efficient way to solve the problem since it reduces the search space for the correct positions of the queens by N. However, this is not the only way to store state. You can very well use a 2D array to store both row and columns but that would mean you increase the search space to N^2. To answer your final question, backtracking problems are simply a way of correcting or updating your result and it's done using the function call stack to remember previous choices and then update information. Every solution to a problem has its own unique pattern that one can make use of to solve it. Utilizing an array of size N to represent state is just a pattern specific to this problem. However using backtracking is something more fundamental.

    • @bhanureddy2087
      @bhanureddy2087 2 роки тому +1

      Same

  • @calmyourmind5617
    @calmyourmind5617 2 роки тому +96

    All I understood from the video is She works at salesforce and she graduated from university of Chicago. These will help me to solve any backtracking problem in the interview..

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

      She explained it well but I think you need more practice to understand such stuff

    • @FifthArima
      @FifthArima 6 місяців тому +4

      im just starting to watch, scrolled down , this comment made me LOL.

    • @user-nw9fl1pe4p
      @user-nw9fl1pe4p Місяць тому +1

      😅

  • @arunshankars8398
    @arunshankars8398 2 роки тому +69

    Excellent video. This was really helpful. However, because this was an introduction to backtracking, it would have been much better to have started with a relatively simpler problem like generate subsets, or generate permutations.

  • @moudjahidmahamat1726
    @moudjahidmahamat1726 3 роки тому +22

    Great video it’s refreshing as I almost forgot the examples of backtracking algorithms

  • @gergerger53
    @gergerger53 2 роки тому +10

    Well, that was weird. The code submitted for the N-Queens problem had clear errors in it, i.e. the return statement that would only return the first solution found (instead of collecting all solutions, as the question asks us to do) as well as an incorrect function call in state_to_string (missing 'n' parameter). It seemed this must have failed, the code was fixed and resubmitted, but this was edited out. I don't like that. That's quite sneaky.
    Beyond that, like others have said, this video underdelivers in terms of promising more of a strategy-based generic implementational plan. It's just function templates and 30 mins of watching a coding solution instead. The logic for why you only need to discard solutions on the diagonals for the adjacent row in the N-Queens problem and lots of other important details are just not explained.

    • @andreisv
      @andreisv 2 роки тому +2

      True about the "state_to_string", but the return statement exits only one recursive stack call (it is kind of redundant as it would anyway happen due to lack of candidates), all solutions should be still there

  • @flanker8415
    @flanker8415 3 роки тому +14

    I believe using graphs to visualize backtracking is the best approach, with practice we can settle on the template of code.

  • @anasbraim4489
    @anasbraim4489 3 роки тому +11

    Keep going, your are amazing 😍😍

  • @tvbuff
    @tvbuff 3 роки тому +93

    Almighty God !! Protect this channel at all costs ❤

  • @OfferoC
    @OfferoC 2 роки тому +2

    This was fantastic! I love this general approach to solving backtracking problems. This has been very insightful. Thank you!

  • @puneethsatwikvemula561
    @puneethsatwikvemula561 3 роки тому +17

    Thanks , can u upload a more comprehensive video on backtracking?

  • @rossfraney2694
    @rossfraney2694 3 роки тому +2

    In terms of 3:51, the state is not "invalid" as mentioned right? It' just the case that it is not optimised, but it still satisfies the "valid" state of no queen being capable of attacking another?

    • @AdamEspinosa
      @AdamEspinosa 3 роки тому

      It's invalid as you need to place 4 queens, but once you place the third there will be no valid spaces left.

  • @kd6164
    @kd6164 3 роки тому +1

    Great video and important concept to learn that was well explained; well done.

  • @sonaliyadav511
    @sonaliyadav511 3 роки тому +7

    at some points she has just written the line of code without explaining the reason why. not at all a beginner friendly video. just writing the code is not enough, the concept behind the design is important, which she did not share at all.

    • @darshanrock2805
      @darshanrock2805 3 роки тому +3

      Very true, i came here seeing the backtracking title of video, i thought she would teach us how to approach to backtracking problems but videos turns out to be an explanation to Queens Problem and Sudoku Problem.

  • @dj_meta
    @dj_meta 3 роки тому +1

    Frankly, just amazing!! Thanks a lot.

  • @nicolash2103
    @nicolash2103 3 роки тому +4

    Damn! the clean explication to resolve the problem that's insane. I would gladly have that kind of code in my work

  • @sawcondeez
    @sawcondeez 3 роки тому

    Wow, this is a fantastic walkthrough

  • @PrashantNigam
    @PrashantNigam 3 роки тому

    Java version for N-Queens problem: tinyurl.com/6244hpvc

  • @thedingo8833
    @thedingo8833 3 роки тому +2

    If I needed to learn one of the courses you teach for a remote job. Which course is most sought after by employers and I can learn here. 🙏🏻

    • @thedingo8833
      @thedingo8833 3 роки тому

      @Pinned.by. TechLead my phone won’t let me initiate on WhatsApp. You have to invite me. It’s wonky.

    • @vali69
      @vali69 2 роки тому +1

      @@thedingo8833 thats a bot trying to scam you. Please learn more about internet literacy.

    • @thedingo8833
      @thedingo8833 2 роки тому

      @@vali69 thank you. I will. 😅💦

  • @bsal5347
    @bsal5347 3 роки тому +17

    Screw these University exams , i can't wait to code again 🔥

  • @Albert-fe8jx
    @Albert-fe8jx 3 роки тому

    Thak you Lynn. OUtstanding presentation and code.

  • @quincylarsonmusic
    @quincylarsonmusic 3 роки тому +3

    Thanks!

  • @jpnr8
    @jpnr8 3 роки тому

    all your videos are gold..

  • @givensimakando4298
    @givensimakando4298 3 роки тому

    This is great 👏 waiting for more learson

  • @mercantilistic
    @mercantilistic 8 днів тому

    Why does this crash course start with a difficult backtracking problem instead of building up to it with progressive exercises?

  • @homesweethomehomesweethome545
    @homesweethomehomesweethome545 3 роки тому

    Excellent. Thank you 🕊😌

  • @raphaelmapp8407
    @raphaelmapp8407 3 роки тому

    Great video. You just gained a subscriber

  • @yashkameshwar6518
    @yashkameshwar6518 3 роки тому +1

    Always wanted this

  • @srica3731
    @srica3731 2 роки тому +1

    Is there a Javascript equivalent of these methods please?

  • @NYBlueBlueSky
    @NYBlueBlueSky Рік тому +4

    This video doesn't explain backtracking and what is that at all. so it's not a "Crash Course". I am new to backtracking and it losted me halfway by just telling us to follow the template coding. Here is a good video I found which I understand well after I watched this ua-cam.com/video/H232aocj7bQ/v-deo.html.

  • @arkochowdhury9190
    @arkochowdhury9190 3 роки тому

    Best coding video ever

  • @zxhu8381
    @zxhu8381 2 роки тому +1

    Well-explained. You are the best.

  • @paragnaik9826
    @paragnaik9826 3 роки тому +2

    Well done

  • @simsim2159
    @simsim2159 3 роки тому

    Please more such videos!!

  • @yahuiz7877
    @yahuiz7877 3 роки тому

    love!!!

  • @sathishkumarsekar7240
    @sathishkumarsekar7240 3 роки тому +3

    Avengers "PROTECT THIS CHANNEL".

  • @matiasrobledo7473
    @matiasrobledo7473 3 роки тому +1

    ¡Gracias!

  • @samadhi7253
    @samadhi7253 3 роки тому +1

    Light theme, god help me my eyes ahhhhh....

  • @aditya_asundi
    @aditya_asundi 3 роки тому +1

    Yo FCC please upload a UE4 blueprints tutorial

  • @triggeredcomments4009
    @triggeredcomments4009 3 роки тому

    Great I have exam in approximately 3hrs

  • @Thrashmetalman
    @Thrashmetalman 2 роки тому +3

    good leetcode video but doesnt really give a solid foundation on backtracking if the person is a beginner.

  • @ismailkharrobi8162
    @ismailkharrobi8162 3 роки тому

    Thanks ❤️

  • @Mohit-il9gx
    @Mohit-il9gx 3 роки тому

    A video on hashing in java please ....!!!!!!!!!!!!!

  • @ganalytical
    @ganalytical 3 роки тому +1

    Yaay

  • @hamoodhabibi7026
    @hamoodhabibi7026 2 роки тому

    Nice template, but the code got so large and confusing lol

  • @ankanbasu7381
    @ankanbasu7381 3 роки тому

    12:27 line 21. what is that syntax ? someone plz tell me.

    • @robbyoconnor
      @robbyoconnor 3 роки тому +4

      It's a class instance function. In python "self" is what Java and other languages would call "this" -- think of it as a pointer or reference to the current instance of the class.

    • @ankanbasu7381
      @ankanbasu7381 3 роки тому

      @@robbyoconnor yes. i know about self in python. but i meant the syntax was "function name -> something".
      what does that arrow do ?

    • @robbyoconnor
      @robbyoconnor 3 роки тому +2

      @@ankanbasu7381 it's new to Python 3 for type-safety.

    • @ankanbasu7381
      @ankanbasu7381 3 роки тому +2

      @@robbyoconnor okk. thanks for your explanation !

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

    nothing about backtracking concept, just leetcode solution...

  • @Sabinajorina
    @Sabinajorina 23 дні тому

    Jones Charles Allen Elizabeth Wilson Timothy

  • @sciencegeeks1370
    @sciencegeeks1370 3 роки тому +6

    My theory: for every n x n board, a maximum of n queens(chess) can be put on it without any of them in each other’s way.

    • @therealjustincase
      @therealjustincase 3 роки тому +9

      2x2 … ?

    • @humblespace9417
      @humblespace9417 3 роки тому +6

      @@therealjustincase checkmate 😂

    • @Manman-sw7vc
      @Manman-sw7vc 8 місяців тому

      Can you do it in 2x2 and 3x3? :)

    • @sciencegeeks1370
      @sciencegeeks1370 8 місяців тому

      @@Manman-sw7vc I guess it should be for n > 3.
      Tbh this was a long time ago and I can't remember my thought process lol

  • @sondralarkins4196
    @sondralarkins4196 5 днів тому

    Taylor Anna Rodriguez Jason Martin Steven

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

    Her lips movements are not real, this is a.i.

  • @swamulugaday4839
    @swamulugaday4839 3 роки тому +1

    freecodecamp do a video on
    1. UML&design patterns
    2. compiler design
    3. Management and organizational behavior
    4. Distributed systems
    5. computer graphics etc..............

  • @JosiePhillips-w3s
    @JosiePhillips-w3s 9 днів тому

    Gonzalez Kimberly Brown Amy Davis Michael

  • @newpattern2208
    @newpattern2208 3 роки тому

    Got past over head .... Hate chess

  • @programming3043
    @programming3043 2 роки тому +2

    Sorry but its boring

  • @ee-shan5125
    @ee-shan5125 3 місяці тому

    Can I get Lynn's IG plz..

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

    Damn, it feels like a tiktok voice would have read the script better.

  • @abhi4u900
    @abhi4u900 2 роки тому

    Seems like watching leetcode solution directly..

  • @tanveer.shaikh
    @tanveer.shaikh 3 роки тому +2

    Is she a robot

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

    python should be banned from this planet

  • @少亏点就行
    @少亏点就行 3 роки тому +1

    这个小姐姐是中国人吗

  • @mrrishiraj88
    @mrrishiraj88 3 роки тому

    🙏👍

  • @scarscar3777
    @scarscar3777 3 роки тому

    ارجوك الترجمة العربية ارجوك

  • @AbedDan
    @AbedDan 4 місяці тому

    You need first to explain it on a white board

  • @kavishkadeneth9692
    @kavishkadeneth9692 3 роки тому +1

    1st view

  • @criuserichard9609
    @criuserichard9609 3 роки тому

    This is not the first time i am hearing of Mrs Cynthia Solomo and her amazing trading skills but i have no idea how to get her

  • @pandorahommond9737
    @pandorahommond9737 3 роки тому

    Wow, amazing to see others who trade with Mrs Cynthia Solomo. I'm currently on my 5th trade with her and her portfolio has grown tremendously

  • @VoltBoosting
    @VoltBoosting 3 роки тому +1

    first

  • @bolantesocth730
    @bolantesocth730 3 роки тому

    I have traded with a lot of individuals but i have never come across anyone as good as Mrs Cynthia Solomo , just by appling her strategies i now trade independently. she is the best i advice any novice in investing to trade with her.

    • @wian7284
      @wian7284 3 роки тому

      ROFL!! even here?

  • @aprilmintacpineda2713
    @aprilmintacpineda2713 3 роки тому

    Why is it that women who code are soooooooo attractive?

  • @charan2446
    @charan2446 3 роки тому

    Clearly FCC.org reads my mind. Its 3rd time they uploaded a video thats in mind or about to do but donno how.

  • @jaya_surya
    @jaya_surya 3 роки тому

    Thanks!