This commit is contained in:
2022-11-30 18:20:36 +08:00
parent b13cfa00bb
commit 72555b19e0
132 changed files with 332 additions and 334 deletions

View File

@@ -1,11 +1,11 @@
#include "s0037_sudoku_solver.hpp"
// 返回结果为当前传递进去的数独是否存在解
bool recusiveSolveSudoku(vector<vector<char>> &board,
vector<unordered_map<char, bool>> &rows,
vector<unordered_map<char, bool>> &cols,
vector<unordered_map<char, bool>> &grids, int row,
int col) {
bool S0037::recusiveSolveSudoku(vector<vector<char>> &board,
vector<unordered_map<char, bool>> &rows,
vector<unordered_map<char, bool>> &cols,
vector<unordered_map<char, bool>> &grids,
int row, int col) {
int size = board.size();
// 边界校验
if (col == size) {
@@ -49,7 +49,7 @@ bool recusiveSolveSudoku(vector<vector<char>> &board,
return false;
}
void Solution::solveSudoku(vector<vector<char>> &board) {
void S0037::solveSudoku(vector<vector<char>> &board) {
// 每个行/列/单元格中某个数字是否出现过
vector<unordered_map<char, bool>> rows;
vector<unordered_map<char, bool>> cols;