Create a Sudoku Solver In Java In 20 Minutes - Full Tutorial

Поділитися
Вставка

КОМЕНТАРІ • 343

  • @19joni69
    @19joni69 2 роки тому +51

    Making a sudoku solver was actually the very first project I programmed once I'd learned the basics. This takes me back.

    • @yahia1355
      @yahia1355 Рік тому +5

      Wow ! I have been coding for arround 5 years and could'nt come up with a solution!

    • @19joni69
      @19joni69 Рік тому +4

      @@yahia1355 oh I didn't do anything smart. I literally brute forced a solution. Basically going over every single square and trying the first number that works, then if I got to one that had no possible correct number I would go back until the first square that I could have put a different number in and tried the different number. Do that until you can fill every square correctly. Just literally trying every combination until it works. There are much better ways to solve this. But the not so smart solution works.

    • @user-cg4vi4kn4v
      @user-cg4vi4kn4v 3 місяці тому

      @@19joni69 🤣🤣😂

  • @clo-1588
    @clo-1588 2 роки тому +87

    You're an excellent teacher, John. I find your videos not only extremely helpful, but impressively well-made - and it's not even so much about the format (which is ideal), but the way you teach and the examples you give. You explain things in a logical, progressive way, and you're excellent at providing the right level of exposure. I do wish there were more teachers like you in universities - but then, we might not have you on UA-cam ;) Please keep going with these tutorials, you are contributing to the community in a huge way.

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

    This was, legitimately, the most interesting java tutorial I've seen in years! EXCELLENT!!!!!

  • @janekk3397
    @janekk3397 Рік тому +3

    I'm so glad channels like this one exist. It was a part of my project and I would've never figured that out myself...

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

    This program works perfectly. What a flawless algorithm you have written .

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

    Thank you! Amazing video, where I work I tried several times create something to solve our work schedule with some kind of algorithm but always fail, this was just exactly what I needed and hope to solve my needs. Thank you!

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

    very nicely explained John, I saw few other videos as well for Sudoku Solver, but this is amazing!

  • @jagi7976
    @jagi7976 Рік тому +3

    It’s beautiful when something that’s educational is also entertaining

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

    This is excellent .. i simply love the naming conventions of the vars..which makes its easy to read and understand the logic

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

    it is amazing to see various algorithms that be used to solve sudoku, i made one but using while loop

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

    This is the best video I found online for this problem. You are a great teacher, thank you.

  • @penguin7863
    @penguin7863 Рік тому +2

    Sir before I watch your video I was a student who was struggling to solve recursion problems for my upcoming test. Now I get the idea about how to backtrack in recursion :) Huge thanks from South Korean student!

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

    I didn't think this solution would have an adequate time complexity. Thanks!

  • @sharadgupta8576
    @sharadgupta8576 2 роки тому +8

    It was just really awesome and in so nice way u described it's just really wow... M so surprised why just so less likes I have watched couple of videos before but u just explained really understanding with gotcha learn some new concept as well successfully found my final year project as well thanks for making this video... I will surely check out your more videos.. Great job 👍

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

    Great explanation and great mini project
    Thank you so much. Looking for more project like this

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

    This was such a good explanation!!! I feel a lot more confident about implementing this. Also thanks for not acting like this is easy/obvious👏

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

    Great video, your explanation was pretty clear!

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

    You just nailed it. Mind blowing tutorial, no doubt.

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

    This was really nice, fun and informative!

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

    Your explanaition is soo cool! You even make feel this stuff is easy.

  • @jhuluan-jyun2594
    @jhuluan-jyun2594 2 роки тому +1

    No wonder you’re a lead! Very clear sir, thank you

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

    Great video, I really enjoyed your explanation. Super thanks, this was very helpful

  • @krishnawadhwani5393
    @krishnawadhwani5393 2 роки тому +65

    I had recently discovered this channel, haha, and I started to watch your videos on TV Like I am watching some movies or some kind of entertainment, nice videos keep it up, subscribed after watching 2-3 videos

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

    OMG, I understand how to solve this complex problem now. Thank you so much!

  • @prade1
    @prade1 Рік тому +2

    This is exactly what I was looking for to complement my java studies. Projects with step-by-step explained.
    Please, keep it going, unfortunately here on UA-cam, everything seems to be only JavaScript or Python. It would be great more projects with OOP.

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

    Great coding John! I got a "Hard Sudoku" solved in a few ms !

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

    Great video! Thanks for this kind of tutorials John! :D

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

    Well explained!
    Thanks John

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

    Amazing! Thanks for this, this helps me stay engaged in java

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

    Simply Nailed It, AWESOME EXPLANATION

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

    Thanks for the great explanation! Keep it up with the channel!

  • @Bury11
    @Bury11 2 роки тому +4

    cool project :) i'm fairly new to java, i programmed a small snake'ish game, so i understood the 2d array way better then i thought :D keep up the good work!

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

    Hey, John I loved the way you went forward with explaining the video , you made it quite easy to learn the algorithm and fun too, i was curious if we can attach some image recognition tools like OpenCV etc for Java , so that we can scan a sudoku at run time and give an image back? I would love if you could show us how to do this if you like the idea.

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

    This tutorial is excellent John.

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

    Great explanation, easy to understand, even for beginners :-) Thanks!

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

    I wrote a Sudoku solver in 2008 in Javascript, but it didn't quite use full recursion (my mistake) so it wouldn't solve moderately difficult puzzles. Mine includes character recognition of uploaded websuduko puzzles. This week I added "paste from clipboard" so that I didn't have to save/load my puzzle images. Today, following your model I finally got mine solving even the "evil" puzzles. Thank You John for this great lesson. Although now I don't feel that "I wrote the code", my page works and I did right the optical character recognition parts. I don't believe that I can share a link here, but I can try.

  • @luigiq6429
    @luigiq6429 3 роки тому +5

    Great video John. Congrats on 500 subs!

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

    Thanks so much John. I spent a lot of time searching on youtube for a good tutorial on this. I wish yours was the first video so i could have saved time :(

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

    Watching couple of videos from this channel every day in any order. But still makes sense

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

    I have reached the part where I didn't find a solution to erase the all the numbers of the board and to retry. I know it needed some recursion, but didn't figure out how. Your explanation was excellent and after reviewing your method, everything makes sense. Thanks and keep it up with these kind of videos!

  • @kingsuley0581
    @kingsuley0581 9 місяців тому

    Loved this!

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

    Beautifully well explained, thank you sir.

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

    Loved your explanation..keep it up buddy 😊

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

    How did you make it so simple, I always appreciate your content. your content is limited on youtube but whenever I get stuck in any problem and you have a video on that, which means, my last destiny is your video. Thank you

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

    In an intro to programming textbook I own, it mentions in the preface that one difference from prior printings is that it removes the sudoku solver example code from the multidimensional arrays chapter because apparently is it too complex at that point.

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

    As always, thank you John.

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

    Awesome, exactly the kind of UA-cam channel I wanted:
    Regularly uploaded coding videos.

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

    I like what you doing, Hope you get the chance to do Dijkstra’s algorithm, Time complexity and a few more interview related.
    I like your explanations

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

    Fantastic stuff!

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

    Really helpful!

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

    Loved it! 🔥

  • @Daniel-iy1ed
    @Daniel-iy1ed 2 роки тому

    That was fantastic. Thanks 🙏

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

    Excellent explanation 👏👏👏

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

    Wow! That’s so cool! This was an awesome video! Very interesting :)

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

    Bro, thank you for teaching. You are the go to guy!

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

    Awesome Tutorial

  • @b9944236
    @b9944236 11 місяців тому

    Now I can solve it by myself, thanks a lot.

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

    Fantastic video and fantastic channel, your videos are great thanks .

  • @surajverma-ut4kj
    @surajverma-ut4kj Рік тому

    Just one word for John 🙏🏼
    Big ThankYou ❣️

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

    Very interesting tutorial!

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

    love this!

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

    Great tutorial !

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

    Very nice. I do this stuff for fun. Recently did one of those word search generators which you see kids books all the time. Way more interesting to do than you may initially think.

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

    Dude, thanks a lot!! You saved me

  • @footballalliance2412
    @footballalliance2412 3 роки тому +10

    Hi John, i have learned a lot from your videos. I hope you won't stop making videos in upcoming days, it is really helpful for us.
    I can guarantee you will get a huge subscribers in coming days.

    • @CodingWithJohn
      @CodingWithJohn  3 роки тому +10

      Thanks! Glad you're getting something out of them. I'll keep making them if people keep watching them!

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

    I like that you also play binding of issac 🙂.
    As for the program I loved it. It was well made video for beginners and one can't not understand the concept. Keep it up! 👍

  • @user-sr7ht8rm6r
    @user-sr7ht8rm6r 8 місяців тому

    John, thank you for everything! Could you maybe make a video on backtracking specificaly? That would be awesome! :)

  • @user-jh9ut7in8i
    @user-jh9ut7in8i 2 роки тому

    like your explain!!
    very clear!!!!!

  • @sweetysojrani9323
    @sweetysojrani9323 4 дні тому

    Awesome algorithm. It would be nice, if you could also explain the time complexity of the algorithm in your video.

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

    Awesome johnny...

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

    WOW.. you are amazing....clean.. detailed.. explanation.
    Please do Leetcode problems also.. It will help us.

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

    This is cool, thanks man

  • @Darya-pu6ik
    @Darya-pu6ik 2 роки тому +1

    its fantastic, i really like the way you teach, its intresting! However, could we do it using DP or is the an NP?

  • @strawberrykitty8337
    @strawberrykitty8337 2 місяці тому

    thank you so much!!!!!

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

    amazing professor!

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

    Thank you very much!

  • @mohammadsadrayeganehfaal2323

    such a enjoyable algorithm!!!

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

    Wow sir you can explain things very well, let aside being multitasker.

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

    wow,next level explanation

  • @samuelnilsson5505
    @samuelnilsson5505 7 місяців тому

    Love this

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

    You make truly great videos

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

    Brilliant!

  • @Pennervomland
    @Pennervomland 2 роки тому +4

    I‘d love to see this exact algorithm but more efficient. Knuths Algorithm X for sudoku sounds very interesting and shows a pretty good method for backtracking. I‘m too dumb to understand how to implement it in java but it could be a cool challenge for you.

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

    Gr8 vid. Spent the last 2days working on this really breaking it down. I got a lot outta following and really understanding what’s going on here. Keep them coming…🙌🏿🙌🏿

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

    Wow! Sooo nice and free! Instant sub and hooked. Binge time.

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

    this is a quality tutorial

  • @wombozombo
    @wombozombo Рік тому +2

    Fun way to learn about recursion 👍

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

    it is 100% working teacher john and thank you for the source code

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

    Its amazing ❤️

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

    Awesome!

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

    I think that those nested for loops on the solve method are unecesary, you could add two additional params to send the current row and column and inside the function you just would need to either add the the rows or to the column depending on what you are doing... yes you will have to put some IF's, but the way you did it I think it will do unnecesary iterations, I mean, the last recursive call on a solvable board will put the needed number but there's nothing that would stop the initial call to the solve method from stopping it's iterations. Actually, on each recursive call it will have to traverse as far as possible on the board until sending back a false or a true if solved. You don't need the algorithm to traverse almost the whole board on each recursive call, you just need it to make a single step on the board instead.

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

    Please make a video on the Hand Of Poker (Poker Hands) Game, it seems to be used alot on interview assessments this days. I am sure alot of people need it.

  • @bartomiejpotaman6973
    @bartomiejpotaman6973 6 місяців тому

    Shit took me a while but I think that's why it was worth it. This video made recursion seem so much more intuitive. Thank you!

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

    I think, i just found my best youtuber. Keep up the good work John.

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

    Subscribed !!

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

    Great video

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

    Awesome video

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

    if you could make a short tutorial about binary search trees and how to understand recursion there..

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

    I user "Thread.sleep(50);" with try and catch to print all numbers one by one. But now I also try to avoid this step for the part where I want to print the default grid with the zeros.
    Thanks for the Idea and I will play with it a little longer :)

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

    Hello John, why didn't you use TDD in this example? This could be a nice addition, because it constantly keeps the code in check