MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / solve

Method solve

Sudoku-Solver.cpp:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 }
6
7 bool solve(vector<vector<char>>& board){
8 for(int i=0; i<board.size(); i++){
9 for(int j=0; j<board[0].size(); j++){
10 if(board[i][j] == '.'){
11 for(char c='1'; c<='9'; c++){
12 if(valid(c, board, i, j)){
13 board[i][j] = c;
14 if(solve(board) == true) return true;
15 else board[i][j]='.';
16 }
17 }
18 return false;
19 }
20 }
21 }
22 return true;
23 }
24
25 bool valid(char c, vector<vector<char>>& board, int row, int col){
26 for(int i=0; i<9; i++){

Callers

nothing calls this directly

Calls 2

solveFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected