#include <leetcode.h>
|
static bool | checkValid (vector< vector< int > > &matrix) |
|
◆ checkValid()
bool leetcode::check_if_every_row_and_column_contains_all_numbers::Solution::checkValid |
( |
vector< vector< int > > & |
matrix | ) |
|
|
static |
在文件 leetcode.cpp 第 625 行定义.
626 const unsigned int n = matrix.size();
627 for(
int i = 0; i < n; i++) {
628 auto *
const row =
new bool[n + 1];
629 memset(row, 1, (n + 1) *
sizeof(
bool));
630 for(
int j = 0; j < n; j++) {
631 if(!row[matrix[i][j]]) {
635 row[matrix[i][j]] =
false;
640 for(
int j = 0; j < n; j++) {
641 auto *
const column =
new bool[n + 1];
642 memset(column, 1, (n + 1) *
sizeof(
bool));
643 for(
int i = 0; i < n; i++) {
644 if(!column[matrix[i][j]]) {
648 column[matrix[i][j]] =
false;
该类的文档由以下文件生成: