-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution36.hpp
More file actions
36 lines (32 loc) · 993 Bytes
/
Copy pathSolution36.hpp
File metadata and controls
36 lines (32 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Solution36.hpp
// Algorithm
//
// Created by Pancf on 2020/10/17.
// Copyright © 2020 Pancf. All rights reserved.
//
#ifndef Solution36_hpp
#define Solution36_hpp
#include <stdio.h>
#include <vector>
class Solution36 {
public:
bool isValidSudoku(std::vector<std::vector<char>>& board);
static void test()
{
std::vector<std::vector<char>> board = {
{'.','.','.','9','.','.','.','.','.'},
{'.','.','.','.','.','.','.','.','.'},
{'.','.','3','.','.','.','.','.','1'},
{'.','.','.','.','.','.','.','.','.'},
{'1','.','.','.','.','.','3','.','.'},
{'.','.','.','.','2','.','6','.','.'},
{'.','9','.','.','.','.','.','7','.'},
{'.','.','.','.','.','.','.','.','.'},
{'8','.','.','8','.','.','.','.','.'}
};
Solution36 s = Solution36();
printf("%s\n", s.isValidSudoku(board) ? "true" : "false");
}
};
#endif /* Solution36_hpp */