Scribe
Scribe

¿Te gusta? Haz que Scribe sea aún mejor dejando una reseña

Obtener Extensión para Chrome

Explorar

  • Videos Populares
  • Videos Recientes
  • Todos los Canales

Herramientas Gratuitas

  • Descargador de Subtítulos de Video
  • Generador de Marcas de Tiempo de Video
  • Resumidor de Videos
  • Contador de Palabras de Video
  • Analizador de Títulos de Video
  • Búsqueda de Transcripciones de Video
  • Analíticas de Video
  • Creador de Capítulos de Video
  • Generador de Cuestionarios de Video
  • Chat con Video

Producto

  • Precios
  • Blog
  • Obtener Extensión para Chrome

Developers

  • Transcript API
  • API Documentation

Legal

  • Términos
  • Privacidad
  • Soporte
  • Mapa del sitio

Derechos de autor © 2026. Hecho con ♥ por Scribe

— Si esto hizo tu vida más fácil (o al menos un poco menos caótica), ¡déjanos una reseña! Prometemos que nos alegrará el día. 😊

Related Videos

Codewars 3 kyu Sudoku Solver JavaScript & Puppeteer Bot

Video thumbnail
441,133 Palabras5m readGrade 18
Compartir
Channel
Ramon Cortes
hello everyone a couple of months ago I tried to solve the Sudoku solver which is a 3Q code Wars exercise and I I was struggling a little bit so I left it alone and um a few days ago I tried again and started from scratch and I I was able to solve it finally I think it took me uh over two hours to solve it but I liked the end result because the main part of the program is in just a single line of code which I liked is array functions chained together and um after
I finished I made a small bot using a puppeteer to access our website to extract the the puzzle information into an array have the algorithm solve it then write the solution back into the website all uh automatically and I also like that result so let's I will show you my logic and I will show you a couple of examples of the bot solving the Sudoku puzzles I want to point out that this is the trick use the cool solver by pineapple clock and it's the easy one I I think there are a couple of uh
not so easy ones see so this is a the terminable meaning there's no need to guess so you will find at least one position into the puzzle where there's uh only one solution so it's not that complicated okay before we continue uh there's a spoiler alert because I will show you um pretty much all my codes so if you want to solve it on your own uh you should stop looking at the next part of the video so this is the the puzzle as you will receive it okay so my logic is is this you
receive the puzzle and while it's not solved you will find in this nested Force because you have to check I I wanted to check every position and see the possibilities of the numbers that can be placed into that position into the puzzle so if there's only one possibility I will write it down and continue again until the Apostle is solved I I included the max cycle so there's only 100 Cycles as a fail safe just in case I run into um on the terminal puzzle so let's see at what they find possibilities function actually does
so this is the important function and after thinking a little bit I realized that what I wanted to do was to Simply type all the numbers and the filter the numbers that are already there and remove those so for example let's take um x equals 3 and Y equals one so that would be this position so what we need to do is find out which numbers are in into this row this column and this mini Square and remove them from our number list so these are the possibilities which we start with and let's start with
the row because it's the easiest one so we will want to filter all these all these numbers by using this particular row and we want to check that every element into the row is different from our numbers so in this case and there's then number one and number two so those two numbers will not pass the filter and therefore will be removed okay so that was the easiest part and this took me actually a little bit but then I realized the next part it's also a filter and there's no need to start with all the
numbers again so we will filter starting from the remaining numbers of course the next part is the row so before we run our filter we want to map our puzzle and only keep the elements that have the same index as our X so that will return all these numbers we want to plot them to have a one-dimensional array and we will have the same as we did right here and by coincidence the the code is almost on top of one another then this as you can see is exactly the same function we want to check
that every element into this new array is different from the remaining elements into our number list so we have three four eight and a nine so those will be gone foreign so by this point we already already have three possibilities and we finally have to do the same filter but with the numbers [Music] listed here so this was the most challenging part because before running the final filter we need a slice of the puzzle and I realized that by dividing by 3 slurring it and multiplying by three we will get for for index 0 1
and 2 we will get zero four three four and five we will get three and for the next part we will get six so by making this slice three positions so one two and three and we will get this subarray or this slice of the array and then we will we will have to map that new sub array and filter the index so that the index is bigger than again this operation but now with x and uh less than two positions more so finally we will get this slice of the array we will want to
Flat it to get a one-dimensional array and finally we will be able to perform the same function function as before that every element into this array is different from our number list so there is one eight and a nine and they are no longer into our list so for this particle particular position we will get these three possibilities so as you saw in the in the code before we will want to find um a position where there's only one possible solution to write it down so without going into much detail a a used Puppeteer to
create this small bot to test my algorithm into our real website real Sudoku website so this is the website that I found would be easy for me to to create a boat for so I open the website I had to increase the timeout a little bit maybe my computer is slow and then I extract all the information from the Sudoku table or boards and after getting the solution with the previous algorithm I type it back and that worked well I will leave a couple of examples here so you can see and if you want to
check the code I I will leave a link into the description for my GitHub page so I hope it was useful for you goodbye [Music] thank you [Music] [Music] thank you [Music]
Videos Relacionados
How to Clone Most Languages Using Tortoise TTS - AI Voice Cloning
29:40
How to Clone Most Languages Using Tortoise...
Jarods Journey
19,182 views
Codewars Sudoku Solver Kata - Solving Sudoku with Javascript
21:00
Codewars Sudoku Solver Kata - Solving Sudo...
TheRandomCoder
692 views
I Forgot How to Use Regex... - JavaScript CodeWars Challenges #1
22:34
I Forgot How to Use Regex... - JavaScript ...
dcode
2,367 views
AI Learns How To Play Doodle Jump
12:02
AI Learns How To Play Doodle Jump
Tyler Mommsen
271,452 views
The Oldest Unsolved Problem in Math
31:33
The Oldest Unsolved Problem in Math
Veritasium
9,201,846 views
Minesweeper solver JavaScript
4:17
Minesweeper solver JavaScript
Ramon Cortes
70 views
Python Sudoku Solver - Computerphile
10:53
Python Sudoku Solver - Computerphile
Computerphile
1,201,362 views
Coding a Web Server in 25 Lines - Computerphile
17:49
Coding a Web Server in 25 Lines - Computer...
Computerphile
333,274 views
Why It Was Almost Impossible to Make the Blue LED
33:45
Why It Was Almost Impossible to Make the B...
Veritasium
24,255,251 views
How to push your Codewars to GitHub
6:33
How to push your Codewars to GitHub
Julia F Morgado
10,401 views
The Clever Way to Count Tanks - Numberphile
16:45
The Clever Way to Count Tanks - Numberphile
Numberphile
966,687 views
How to create Ultimate Excel Gantt Chart for Project Management (with Smart Dependency Engine)
3:18:01
How to create Ultimate Excel Gantt Chart f...
The Office Lab
2,706,491 views
Sudoku Solver - LeetCode 37 - JavaScript
9:27
Sudoku Solver - LeetCode 37 - JavaScript
AlgoJS
2,909 views
How to Use Codewars Platform
13:03
How to Use Codewars Platform
AltCampus
26,504 views
ChatGPT is destroying my math exams
11:43
ChatGPT is destroying my math exams
Dr. Trefor Bazett
72,129 views
C# Hard Truths: Program.cs was a Lie, Startup.cs is a Waste of Space, and more...
53:56
C# Hard Truths: Program.cs was a Lie, Star...
IAmTimCorey
50,821 views
Let's make a sudoku solver in 5 minutes (Backtracking) - Inside code
5:39
Let's make a sudoku solver in 5 minutes (B...
Inside code
47,202 views
Python Speed Comparison: Faster Than We Thought?!
23:51
Python Speed Comparison: Faster Than We Th...
NeuralNine
18,763 views
Sudoku Solver | FreeCodeCamp
23:15
Sudoku Solver | FreeCodeCamp
Landon Schlangen
790 views