[Python algorithm] A program that outputs Sudoku answers from a depth-first search

Introduction

Hello, everyone.
Today, I will explain a program that outputs Sudoku answers using a method called depth-first search. It is difficult to explain the example, so please let us know in the comments if there are any deficiencies in the article.

Example

n is a natural number, and N = n ^ 2. At this time, create a board consisting of a total of N ^ 2 squares with N rows and N columns, and divide it into n ^ 2 sections consisting of n rows and n columns with thick lines. ![a0.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/39145/f46ad306-bb0b-87d8-04d2-bd17db4baf79.jpeg)

At this time, write one number from 1 to N in each cell. However, all of the following three conditions shall be met.