MCPcopy Create free account
hub / github.com/chaharnishant11/CodeIn10DSA / helper

Method helper

Backtracking/Code/sudokuSolver.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 return true;
37 }
38 bool helper(int grid[N][N], int row ,int col){
39 if (row==9) return true;
40 if (col==9) return helper(grid,row+1,0);
41 if (grid[row][col] != 0) return helper(grid,row,col+1);
42
43 for(int i=1;i<=9;i++){
44 if (check(grid,row,col,i)){
45 grid[row][col]=i;
46 if (helper(grid,row,col+1)){
47 return true;
48 }
49 }
50 grid[row][col]=0;
51 }
52 return false;
53
54 }
55 bool SolveSudoku(int grid[N][N])
56 {
57 // Your code here

Callers

nothing calls this directly

Calls 1

helperFunction · 0.70

Tested by

no test coverage detected