MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / isBoxSafe

Method isBoxSafe

C++/Sudoku-Solver.cpp:33–45  ·  view source on GitHub ↗

to check whether num is valid in that 3*3 matrix grid

Source from the content-addressed store, hash-verified

31
32 // to check whether num is valid in that 3*3 matrix grid
33 bool isBoxSafe(vector<vector<char>>& board, int row1, int col1 , char num)
34 {
35 for(int row = 0;row<3;row++)
36 {
37 for(int col = 0;col<3;col++)
38 {
39 if(board[row1 + row][col1 + col] == num)
40 return true;
41 }
42 }
43
44 return false;
45 }
46
47 bool isSafe(vector<vector<char>>& board, int row, int col , char num)
48 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected