N-Queens, N-Knights, Sudoku Solver (LeetCode) - Backtracking Questions

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

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

  • @KunalKushwaha
    @KunalKushwaha  6 месяцев назад +5

    DSA + interview preparation playlist: ruclips.net/p/PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ

    • @GuruPruthviJM
      @GuruPruthviJM 6 месяцев назад +3

      Hey, Kunal,
      Actually, your DSA playlist is awesome and I have learnt the recursion and tree basic concepts from you thoroughly thank you.
      Can you please make the videos on Graphs and DP.

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

      Hey buddy its really awesome , can u make furthur videos as u promised to be leaving us in the middle of the ocean .
      :)

  • @Tomharry910
    @Tomharry910 Год назад +16

    I have now watched all the 11 videos in your recursion series playlist. I am now able to understand how recursion functions - how the recursion calls go onto the stack and how it comes out. I feel more confident with recursion which I used to dread earlier and was a nightmare for me. I now feel happier when I learn to code. Your videos has helped hundreds of thousands of struggling students like me and in the coming time hopefully will help millions of students learning to code around the world. Thank you for sharing your knowledge and wisdom so generously and freely with us without even charging a penny. Hope the seeds of learning that you have sowed in our lives, abounds and brings much happiness and success in your life as well. Wishing you the very best life has to offer. Thank you so much, Sensei 🙏💐💐

    • @KunalKushwaha
      @KunalKushwaha  Год назад +5

      You’re welcome

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

      @@KunalKushwaha Hey Kunal, We need the content of Dynamic Programming, Tree and Graph algorithms from you. Please do it as soon as possible.

    • @ChiranjeeviGaming2003
      @ChiranjeeviGaming2003 4 месяца назад

      Thank god i have started learning recurr from kunal not anywhere else , topics are clear now and not seems that much hard my friends used to told me 🥲🥰

  • @mbilal11097
    @mbilal11097 3 года назад +32

    We can't thank this guy enough. Such an amazing course so far.

  • @suhaspatil8682
    @suhaspatil8682 3 года назад +54

    Wow . The best Recursion playlist ever made (according to me) . As you said I have drawn Recursive tree for each and every problem. Yes it was time consuming and it was really tough in the beginning but later on I started enjoying it. So I will suggest whoever thinking to follow this DSA playlist can follow it blindly.

    • @KunalKushwaha
      @KunalKushwaha  3 года назад +13

      Wow, thank you!

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

      I am a beginner in coding can I watch it for good jobs?
      I think it is in Java.

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

      @@rahuls8613 yes

  • @akashvarma4325
    @akashvarma4325 3 года назад +99

    In the isSafe method in the If condition you have written "board[row][col] == num" which is only checking that element for 9 times instead of checking all the forward elements, it is not giving error but the sudoku is not properly solved, instead there should be
    "board[row][i] = num" which will check other elements in the row as well and then the sudoku will be solved properly.

    • @mukeshkumarv5677
      @mukeshkumarv5677 2 года назад +6

      Yeah I also noticed that 😅...

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

      Yeah, you are right, bro!

    • @aakashyadav9117
      @aakashyadav9117 Год назад +4

      You are right i was not able to solve sudoku and this took me 1 hour to find this issue . thanx bro

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

      I saw that too, like in the first row 6 & 2 are getting repeated, and same issue with other rows

  • @jnayehsirine6222
    @jnayehsirine6222 Год назад +7

    its been more than 3 months since i completed the serie and i still rwatch again , thank youuuu !!!!!

    • @general_aptitude_gate
      @general_aptitude_gate Месяц назад

      After completing the series, do you also learn graph and dp? If yes from where?

  • @piyushgupta6290
    @piyushgupta6290 3 года назад +9

    Don't know how people can dislike this kind of content. This is the finest and most premium course I have found not only youtube even the paid contents. And this DSA course is not just a course its like we are feeling the DSA. Making my imagination strong and new thought process starts growing. THANK. YOU KUNAL BHAI YOU ARE LIT!!

  • @Anic10
    @Anic10 3 года назад +223

    Kunal, your series helped me with motivation. I got selected in Morgan Stanley as QA. Thanks brother. 😊

    • @KunalKushwaha
      @KunalKushwaha  3 года назад +51

      That's amazing, congratulations and thank you!

    • @Anic10
      @Anic10 3 года назад +35

      Hi Kunal, first of all a very big thank you. I have started watching your RUclips videos of Data structures #DSAwithKunal. I am an experienced guy with 4 years of Automation Testing experience. I started leetcode when you solved that recursion problem. Your Strings video helped me with clearing concepts. Every QUALITY ASSURANCE guy/girl must also watch this series. #Dsforall
      Currently completing Recursion series.
      Thanks man. A big thank you 🙏

    • @tafiquehossainkhan3740
      @tafiquehossainkhan3740 3 года назад +6

      Bro when will we get all the video..

    • @pythonenthusiast9292
      @pythonenthusiast9292 3 года назад +5

      @@Anic10 but bro how is DSA helping in field of QA ?

    • @Anic10
      @Anic10 3 года назад +14

      @@pythonenthusiast9292 Yes bro.. Big tech companies like Arcesium, Browserstack have coding rounds prior to interviews. In interviews they ask easy to medium problems on linked list,stacks ,queue and time complexities. So to become SDET DSA is necessary.

  • @shafinnahian75
    @shafinnahian75 Год назад +8

    Kudos to you, man. I genuinely found a mentor I can follow. I can certainly see light on the other end of the road, and you're helping me to walk each step - carefully guiding me through every obstacle upfront. Thank you, Kunal. I sincerely mean it.
    Just completed the Recursion playlist ( July 10th, 2023 ). Going to complete a few "Assignments" from your GitHub repo and dive deep into the DSA playlist afterwards.
    I'll keep you updated with that playlist too xD Thanks again, man. If I could, I would've given you the warmest hug (with a box of biriyani of course XD )

  • @trestops
    @trestops 3 месяца назад +1

    When he goes on his rants in between ...its actually funny, like a break in between problems... and Great recursion playlist . Thank you

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

    The way you broke down the ideas and made them so simple to understand and apply is "very next level" :)

  • @studystudy1115
    @studystudy1115 4 месяца назад

    The best course ever. It is better than 99% of paid courses on the internet. Thank you for your hard work and dedication, my master.

  • @Rashmi-bs-09
    @Rashmi-bs-09 Год назад

    Yes, the best Recursion Playlist with progression to Backtracking concept so Far . Thanks Kunal, Keep up the good work .

  • @animeshsingh3748
    @animeshsingh3748 2 года назад +5

    This is literally the best recursion playlist I ever laid my eyes on. You made sure to cover all the doubts that could arise in one's mind. Your explanations were just amazing and you made these problems look so simple. Thanks for all your hard work and dedication. 😊

  • @v-keydixit2231
    @v-keydixit2231 9 дней назад

    Hi @KunalKushwaha, there is a mistake in Sudoku solver, please check once, you did mistake, 1:16:56 look, the numbers are repeated in some row, please check thanks, otherwise everything is mind blowing, your speaking skill, explanation skill, your way to explain, your thought process, methods, tips, examples everything just beyond the expectations, thank you so much for the playlist. Thanks❤❤❤❤❤❤

  • @shivamtyagi2668
    @shivamtyagi2668 3 года назад +14

    it took me 2 days ,but i didn't give up, I SOLVED it, Revised everything I was struggling with

  • @hargunsingh8800
    @hargunsingh8800 Год назад +4

    Hi Kunal,
    Your recursion playlist on RUclips has been a game-changer for me! I have learned so much and have been able to apply the concepts in my coding projects. I would love to see a new lecture series on dynamic programming. I know it's a challenging topic, but I trust your teaching style and explanations to make it more approachable. Keep up the great work!

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

    Watching this video after completing the previous videos, Just makes it so easy to understand ! Thank you so much for teaching this for FREE!

  • @amitbutola2291
    @amitbutola2291 2 года назад +7

    15:50 Simple way to find diagonal left and diagonal right
    // diagonal left
    int r = row;
    for(int c = col;c>=0&&r>=0;c--,r--){
    if(board[r][c]){
    return false;
    }
    }
    // diagonal right
    r = row;
    for(int c = col;c=0;c++,r--){
    if(board[r][c]){
    return false;
    }
    }

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

      i wrote the same thing in my rough before he explained other approach

    • @parvagaglani9630
      @parvagaglani9630 Месяц назад +1

      @@abhinjr4918 Hey had a question I hope u can answer that: should I write in roughly all the logic before he is going to explain or are there any particular things I should brainstorm about and watch the tutorial since I just watch the explanation of theory and code and then try to code myself?

    • @abhinjr4918
      @abhinjr4918 Месяц назад +1

      ​@@parvagaglani9630its actually no use if you are only watching and trying to memorize , I bet you'll regret it in future.
      Even if it may take a long time go for writing logic on your own before he tells.
      Trust me it's the best way and will appreciate yourself in the future.

    • @parvagaglani9630
      @parvagaglani9630 Месяц назад

      @@abhinjr4918 thanks i'll follow on that

    • @progdev-mz2fj
      @progdev-mz2fj 17 дней назад

      Thanks for telling it but shall I go for full solution and code or just for the solution.and how much time shall I invest for it. ​@@abhinjr4918

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

    I always feared of recursion and data structures even after started this bootcamp..i gave up at recursion videos at first but later i thought of giving a shot and now im here and can say that i really loved learning recursion and the way you are teaching is awesome. Looking forward for more videos on this playlist.

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

    complete this playlist and dynamic programming as soon as possible brother you are worth for every student iam loving your content so much

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

    The best I have ever seen... Felt happy from depths of my heart💖💖

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

    Thank you so much for this amazing recursion series!

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

    I dont think anyone will hate recursion after completing this playlist. if they do it must be lack of practice. Lovable course for sure 😍😍😍

  • @petersampodiras6590
    @petersampodiras6590 2 года назад +5

    This is by far the best playlist on youtube. Your teaching is truly amazing. Are you planning on making any videos explaining dynamic programming?

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

    By far the best recursion playlist i've ever seen

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

    thankyou you made coding so interesting its approx. one month following your dsa series i purchased some courses but i never got intuitions then i skipped coding now i am getting intuitions as well

  • @anujraj1000
    @anujraj1000 8 месяцев назад +2

    Just minor correction, while checking the row for the number instead of board[row][col]== num, just replace col with [i] . It will fix the duplication issue.

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

    i dont know why i am not getting this backtracking questions .but still thank you kunal you created the base of recursion .

  • @thankyou2494
    @thankyou2494 3 года назад +3

    I was feeling sleepy but This video is refreshing

  • @hrithikshaw434
    @hrithikshaw434 3 года назад +24

    Once again best quality teaching as always. Thankyou Kunal ❤️

  • @GuruPruthviJM
    @GuruPruthviJM 6 месяцев назад +1

    Hey, Kunal,
    Actually, your DSA playlist is awesome and I have learnt the recursion and tree basic concepts from you thoroughly thank you.
    Can you please make the videos on Graphs and DP.

  • @deepakchourasiya5957
    @deepakchourasiya5957 3 года назад +5

    Soon you will receive silver play button ✌😊

  • @medakremlakhdhar419
    @medakremlakhdhar419 4 месяца назад

    Thank you man, FKING THANK YOU! never thought I’d be able to understand such topics.

  • @adbhuthareddy
    @adbhuthareddy 3 года назад +22

    Never tried to solve a sudoku in my entire life. Now just writing a program for sudoku to solve itself 😎....
    Came a long way 😂
    Thanks @Kunal Kushwaha

  • @VishalKumar-pk9ek
    @VishalKumar-pk9ek 3 года назад +2

    mind blowing.......
    ek ek line of code kya kar raha hai har question me , sab samajh aa gaya 😍😍😍😍

  • @PradeepYadav-fg2yg
    @PradeepYadav-fg2yg 3 года назад +4

    never thought i could literally understand these concepts thankyou for teaching🙏🙏

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

    kunal, waiting for your sliding window concepts badly. Thank you so much for this playlist.

  • @the_ranjit_kumar_nayak
    @the_ranjit_kumar_nayak 3 года назад +3

    I just eagerly wait for your video kunal ❤️

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

    36:35 Really i can assure the code kunal sir does...if you understand it then ... there's no shorter version you can find...

  • @himanshusharma3301
    @himanshusharma3301 3 года назад +7

    I think that for the isValid function if the N- Knights there should be 4 more conditions which are : (r+2,c+1) ,(r+2,c-1),(r+1,c+2) &(r+1,c-2) .

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

      Yeah, total 8 conditions are there.

    • @prasoonlall9432
      @prasoonlall9432 3 года назад +15

      We are moving gradually downwards from each row. So while checking, we need to make sure that the new location doesn't have any knights positioned above that row, as the below rows will be empty at that stage. Hence, he didn't include all 8 conditions. Even if he did add the remaining 4 conditions, they'll always return true as they would contain false at that stage.. Hope you got the concept.

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

      If I am placing a knight at (r, c), where will the previous knight could be present? (keep in mind that we are travelling one row after another)
      Will the previously placed knights be present on the same row as ours and on the rows before it?
      OR
      Can a previously placed knight be found on the rows below our current (r, c)? If not, then do we really have to check for r+1 and r+2 rows?? THINK ABOUT IT.....

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

      bro we only check for the above rows whle placing the knight because we are placing them from top to bottom

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

      Its like we both have eye contact, if i can see you then you can definitely see me .
      Same in knights we only check on top or above moves because there is no knights below . Both has same moves if they intercepted

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

    Thank you soo much for this awesome content, bro ! I learned a lot from in these series !! please make series of dynamic programming

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

    U made it very easy to me tqq kunal❤✌

  • @aswinvignesh3985
    @aswinvignesh3985 2 года назад +6

    @KunalKushwaha +1 mistake, which no one spotted for suprise.
    In nKnights , the loop goes on stops at the last row and last col of matrix , instead of running through it .
    Your code -
    row

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

      For 3 x 3 there should be 36 ans instead we have 25 ans since last box is missed in output.
      Check output there will be no knight in last box in any of those ans

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

    @kunal, It seems that its not correctly solved if you observe the anwer properly 1:17:02, in the first row 6 and 2 are repeating, similarly 3rd row 7 is repeating.

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

    Is this a Java + DSA course or a Netflix series? 🤔 Honestly, it's been so captivating from start to finish with such thorough explanations. Thank you for making learning so enjoyable! Can't wait for more!

  • @Karan-vq5vg
    @Karan-vq5vg 3 года назад +9

    For SUDOKU Solver : Is the if condition under //row check correct? I think it should be if(board[row][i] == num) return false. What is your opinion Kunal?

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

      I guess it is row, i, where it should remove duplicates.

    • @158.sahilsaxena8
      @158.sahilsaxena8 3 года назад +5

      That's exactly i am thinking about... @ 1:07:51 - there is no dependency of if condition on the loop... so how it check row's element..... it should be if ( board [row] [i] == num)
      and the output was also incorrect .... there were a repeating elements is the row....

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

      Yes u r right karan....there should be board[row][i]

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

      Thanks a lot for solution, i just stuck there. And thought where was the actual problem. Thank u.

  • @kavyaN2004
    @kavyaN2004 5 месяцев назад +2

    Kunal.... Please start uploading videos for dynamic programming...! Please.. I have been trying for so long to learn DP but couldn't able to solve the problems. So please start teaching dynamic programming.🥺🥺🥺

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

    Thank you bhiya you are a gem

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

    Excellent video kunal thanks for explaining in such great way .
    I think there is a small mistake in the N knight problem a knight can move in 8 different direction instead of four so I think 8 checks will be required .
    Thanks again for the awesome content.

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

      If I am placing a knight at (r, c), where will the previous knight could be present? (keep in mind that we are travelling one row after another)
      Will the previously placed knights be present on the same row as ours and on the rows before it?
      OR
      Can a previously placed knight be found on the rows below our current (r, c)? If not, then do we really have to check for r+1 and r+2 rows?? THINK ABOUT IT.....

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

      ​@@shubhamrawat3984 thanks for the explanation

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

      No brother your concern is legit, I also had same question but think about it deeply we are starting from first row to bottom and while doing down we have to only check for upwards as there's no any knight placed already in the end rows whereas in upper rows we placed and came down.

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

    39:39 knight is respectable

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

    Thank you soo much for this awesome content, bro ! I learned a lot from in these series !!!

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

    Great job man, you make it look so easy

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

    @kunal i cound not get the time complexity of n queens with akra bazi , but i was able to get it through substitution method , request you to made one video where there are functions like T(n) = N*T(N-1) + g(n) like this

  • @ShubhamGupta-lb5cx
    @ShubhamGupta-lb5cx 2 года назад

    Great explanation 👍

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

    COMPLETE N-KNIGHTS CODE WITH COMMENTS:-
    import java.util.Arrays;
    public class NKnights {
    public static void placeKnights(boolean[][] board,int row,int col,int k){
    //if all the knights are placed,display the board
    if(k == 0){
    displayBoard(board);
    System.out.println();
    return;
    }
    //if we have reached the last row and last col, we don't have to do anything
    if(row == board.length && col == board.length){
    return;
    }
    //if we have reached the last col of a row,we'll move to next row and start looking from first col
    if(col == board[0].length){
    if(row+1

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

    COMPLETE SUDOKU CODE WITH COMMENTS:-
    public class Sudoku {
    public static void solve(int[][] grid,int n){
    solveSudoku(grid,0,0,n);
    }
    public static void solveSudoku(int[][] grid,int row,int col,int n){
    //print the grid if we have reached the last row and last col
    if(row == grid.length-1 && col == grid.length){
    for(int i=0;i

  • @shyamkedia4202
    @shyamkedia4202 3 года назад +3

    Ho could have earn lacks thru this ...
    Thaxxx bruu

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

    ❤️❤️ amazing content

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

    Hi kunnal, I watched all videos in recursion is too good. I like your way of approaching the problem.
    In this video "Sudo solver" output is "incorrect". Because of minor mistake in "isSafe method -> Checking the row".

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

      It's correct I just did a typo with variable in hurry which is mentioned in timestamps

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

      @@KunalKushwaha Yes noticed 👍

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

    100k supersoon 💖

  • @Apna_Gamer-rz2jl
    @Apna_Gamer-rz2jl 11 месяцев назад +1

    how your sudoko code is correct bro.
    look at your answer in the very first row 2 is coming twice at 4 and 6 index

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

    You are my God ❤

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

    can someone help me out, why do we "return" at line 16 in the N Knights problem (timestamp: 46:12), would be highly appreciated

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

      here col=n(board length) if you dont return the code will go aheaa and run issafe function for c=n which will return true and obv u cant place knight there because its not the part of the board also then col will keep on increasing and we dont have any base case for c>n resulting in infinite loop.
      HOPE U UNDERSTAND :)

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

    You r the best🔥🔥

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

      static int queens(boolean[][] board,int row){
      if (row==board.length){
      display(board);
      System.out.println();
      return 1;
      }
      int count=0;
      for (int col=0;col=0;c--,r--){
      if (board[r][c]){
      return false;
      }
      }
      r=row; //right
      for (int c=col;c=0;c++,r--){
      if (board[r][c]){
      return false;
      }
      }
      return true;
      }

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

      hi bro, actually i am stuck, my program doesnt print ans in matrix, instead it print this in one single vertical line, can you help

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

    Damn this course is lit 🔥🔥🔥

  • @Cloud-577
    @Cloud-577 3 года назад +1

    I was waiting for this!! When is dp lecture will be out

  • @UvUtkarsh
    @UvUtkarsh 3 года назад +9

    great video bhai, but at 1:16:52 the sudoku was not solved correctly.
    Edit : Solved vertically but not horizantally, what a coincidence

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

      🥲

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

      Great eye man. I think the first check should be board(row)(i) == num, isn't it?

    • @21AniketThakre
      @21AniketThakre 3 года назад +1

      @@serveshchaturvedi2034 yes that's correct,l👍🏻

  • @satishgajavilli7816
    @satishgajavilli7816 3 года назад +5

    Sir, understanding videos very very well but coming to assignment facing lot of difficulty

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

    u are insane, ty for the content!

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

    Thank you !!

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

    Hey kunal have u added graph in this playlist or any other

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

    good lecture

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

    Ki Kunal, There should be 8 - cases for N Knights Problem under "isValid" Method or I'm doing something wrong ?

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

      we check for the previous rows only, so I guess 4 cases is all

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

    Enjoyed all your recursion videos except for this one, it seemed like u didn't really prepare before making this important video, it felt u were not really explaining but reading, but the other recursion videos helped me a lot so I am really grateful to u for making this series

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

    COMPLETE N-QUEENS CODE WITH COMMENTS:-
    //VALID MOVES-1 queen in a row and col only. if more than one queens are present in a row/col, there'll be a clash
    public class NQueens {
    public static int displayQueensOnBoard(boolean[][] board,int row){ // passing only row and not column bcoz every time the col is going to be starting from 0 only
    if(row == board.length){ // if all the rows have been traversed, then its time to dispay the board
    displayBoard(board);
    System.out.println();
    return 1;
    }
    int count = 0;
    for(int col=0;col

  • @parvagaglani9630
    @parvagaglani9630 Месяц назад +1

    I hope anyone can help me with this: should I write in roughly all the logic before he is going to explain or are there any particular things I should brainstorm about and watch the tutorial since I just watch the explanation of theory and code and then try to code myself?

  • @dineshmadduru7043
    @dineshmadduru7043 7 месяцев назад

    Thank You:)

  • @mercenary-coder
    @mercenary-coder 10 месяцев назад

    bro giving his 100% to promote his previous videos

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

    hey kunal , can we start doing the hard section in your git hub assignment ( after completing recursion series) ?

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

    this video deservs million of views by the by
    when dp lectures coming in your channel

  • @devilsingh6052
    @devilsingh6052 3 месяца назад

    thanks bro

  • @janakiram1187
    @janakiram1187 3 года назад +5

    Bro do some videos on Linkedlist,stacks

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

    Sir ji plz ye course band mat karna or delete bhi nahi karna 🥺😄🤩

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

    Bro ! In 1:17:01 this sudoku is not correct . in first row there is 6 appears in two times .

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

    Kunal please upload DP and graph series

  • @divineknowledge1.9lakhview29
    @divineknowledge1.9lakhview29 Год назад +1

    at 1:07:47 i think board[i][col] should be there i am confused how he solve that using that only

    • @anwaraftab5401
      @anwaraftab5401 7 месяцев назад

      I think you're right, cuz if we put board[row][col] everytime then how will it work...

  • @doshanthsai8726
    @doshanthsai8726 3 года назад +3

    Bro opps concepts

  • @lakshyadhawan800
    @lakshyadhawan800 8 месяцев назад

    in sudoku output, in first row 2 and 6 are repeating and in second row 9 is repeating and many more

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

    at 1:16:57 the value 6 and 2 are repeated ??

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

    Hey, This is great but in some row same digits are repeated in sudoko solver.

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

    I code in JavaScript and Python, will watching the lectures from the beginning be beneficial?
    Will the Theory be beneficial?

  • @AkshitVerse
    @AkshitVerse 6 дней назад

    kunal making simple questoins too complicated , i don't know what is and how to solve it you just complicate me and you know i am stuck in a loop a concept.

  • @Java_dsa_hope
    @Java_dsa_hope 3 месяца назад +1

    Why i get 14 as answer while i put board length is 5

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

    @KunalKushwaha
    34:14 i believe this isn't linear recurrence relation with constant coefficient to use method you taught us in time complexity lecture,
    ig this could be solved using substitution method, but i could not end up with precise answer like that of yours as O(N! + N^3) = O(N!)
    i solved it in the following way
    T(n) = n*T(n-1) + O(n^2)
    => T(n) - n*T(n-1) = O(n^2)
    => (T(n))/n! - (T(n-1))/(n-1)! = O(n^2)/n!
    => (T(n))/n! = ∑ x from 2 to n (x/(x-1)!)]
    == ∑ x from 2 to n (1/(x-2)!)]
    by Maclaurin's expansion for e,
    => (T(n))/n! = O(e)
    => T(n) = O(n!*e)
    ignoring constant terms, we get
    T(n) = O(n!)
    can you please help me with elaborating more on your approach to solve this and get O(N! + N^3) as solution?
    else if someone who know kunal's approach please reply here, I'd really appreciate
    Thanks!

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

    100k soon

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

    Can any one say y he used
    min(row, col) in 27:15

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

    all of you please like the video , don't just go without liking the video

  • @MayankCodes
    @MayankCodes 7 месяцев назад

    The backtracking is not correctly applied in Sudoku solver. Everytime return true in solve(board) hits and since if waa running before that else condition gets untouched making it no application of backtracking. Am I thinking right if anyone can tell??

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

    There's a mistake in the soduku isSafe problem it doesn't check all columns in particular row
    Should be board[row][I] == number
    You wrote board[row][col] == number
    Which just checks the same thing and iterates over... check the first row of answer it has 2 twice second row two has duplicates along the row

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

      yeah that's a typo I made while live coding but self explanatory

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

      @@KunalKushwaha Sure, must be stressful going long hours....Thanks for the playlist anyway really beneficial