#include <leetcode.h>
|
static void | solveSudoku (vector< vector< char > > &board) |
|
|
static bool | dfs (const vector< vector< char > > &board, vector< vector< char > > &ans) |
|
static bool | valid (const vector< vector< char > > &board, int x, int y, char num) |
|
◆ dfs()
bool leetcode::sudoku_solver::Solution::dfs |
( |
const vector< vector< char > > & |
board, |
|
|
vector< vector< char > > & |
ans |
|
) |
| |
|
staticprivate |
在文件 leetcode.cpp 第 8364 行定义.
8365 for(
int i = 0; i < 9; i++) {
8366 for(
int j = 0; j < 9; j++) {
8367 if(board[i][j] ==
'.') {
8368 for(
char c =
'1'; c <=
'9'; c++) {
8369 if(
valid(board, i, j, c)) {
8370 bool haveValid =
true;
8371 vector<vector<char>> next = board;
8373 if(
dfs(next, ans)) {
static bool valid(const vector< vector< char > > &board, int x, int y, char num)
static bool dfs(const vector< vector< char > > &board, vector< vector< char > > &ans)
引用了 dfs() , 以及 valid().
被这些函数引用 dfs() , 以及 solveSudoku().
◆ solveSudoku()
void leetcode::sudoku_solver::Solution::solveSudoku |
( |
vector< vector< char > > & |
board | ) |
|
|
static |
◆ valid()
bool leetcode::sudoku_solver::Solution::valid |
( |
const vector< vector< char > > & |
board, |
|
|
int |
x, |
|
|
int |
y, |
|
|
char |
num |
|
) |
| |
|
staticprivate |
在文件 leetcode.cpp 第 8386 行定义.
8387 for(
int i = 0; i < 9; i++) {
8388 if(board[i][y] == num) {
8392 for(
int j = 0; j < 9; j++) {
8393 if(board[x][j] == num) {
8397 for(
int i = 0; i < 3; i++) {
8398 for(
int j = 0; j < 3; j++) {
8399 if(board[x / 3 * 3 + i][y / 3 * 3 + j] == num) {
被这些函数引用 dfs().
该类的文档由以下文件生成: