MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / isValid

Method isValid

37-sudoku-solver/sudoku-solver.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 bool isValid(vector<vector<char>>& board, int row, int col, char c) {
31 for (int i = 0; i < 9; i++) {
32 if (board[i][col] == c) {
33 return false;
34 }
35 if (board[row][i] == c) {
36 return false;
37 }
38 if (board[3 * (row / 3) + i / 3][3 * (col / 3) + i % 3] == c) {
39 return false;
40 }
41 }
42 return true;
43 }
44};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected