Skip to content

Commit 10ae924

Browse files
committed
Create README - LeetHub
1 parent e4b06f6 commit 10ae924

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

0036-valid-sudoku/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<h2><a href="https://leetcode.com/problems/valid-sudoku/">36. Valid Sudoku</a></h2><h3>Medium</h3><hr><div><p>Determine if a&nbsp;<code>9 x 9</code> Sudoku board&nbsp;is valid.&nbsp;Only the filled cells need to be validated&nbsp;<strong>according to the following rules</strong>:</p>
2+
3+
<ol>
4+
<li>Each row&nbsp;must contain the&nbsp;digits&nbsp;<code>1-9</code> without repetition.</li>
5+
<li>Each column must contain the digits&nbsp;<code>1-9</code>&nbsp;without repetition.</li>
6+
<li>Each of the nine&nbsp;<code>3 x 3</code> sub-boxes of the grid must contain the digits&nbsp;<code>1-9</code>&nbsp;without repetition.</li>
7+
</ol>
8+
9+
<p><strong>Note:</strong></p>
10+
11+
<ul>
12+
<li>A Sudoku board (partially filled) could be valid but is not necessarily solvable.</li>
13+
<li>Only the filled cells need to be validated according to the mentioned&nbsp;rules.</li>
14+
</ul>
15+
16+
<p>&nbsp;</p>
17+
<p><strong class="example">Example 1:</strong></p>
18+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Sudoku-by-L2G-20050714.svg/250px-Sudoku-by-L2G-20050714.svg.png" style="height:250px; width:250px">
19+
<pre><strong>Input:</strong> board =
20+
[["5","3",".",".","7",".",".",".","."]
21+
,["6",".",".","1","9","5",".",".","."]
22+
,[".","9","8",".",".",".",".","6","."]
23+
,["8",".",".",".","6",".",".",".","3"]
24+
,["4",".",".","8",".","3",".",".","1"]
25+
,["7",".",".",".","2",".",".",".","6"]
26+
,[".","6",".",".",".",".","2","8","."]
27+
,[".",".",".","4","1","9",".",".","5"]
28+
,[".",".",".",".","8",".",".","7","9"]]
29+
<strong>Output:</strong> true
30+
</pre>
31+
32+
<p><strong class="example">Example 2:</strong></p>
33+
34+
<pre><strong>Input:</strong> board =
35+
[["8","3",".",".","7",".",".",".","."]
36+
,["6",".",".","1","9","5",".",".","."]
37+
,[".","9","8",".",".",".",".","6","."]
38+
,["8",".",".",".","6",".",".",".","3"]
39+
,["4",".",".","8",".","3",".",".","1"]
40+
,["7",".",".",".","2",".",".",".","6"]
41+
,[".","6",".",".",".",".","2","8","."]
42+
,[".",".",".","4","1","9",".",".","5"]
43+
,[".",".",".",".","8",".",".","7","9"]]
44+
<strong>Output:</strong> false
45+
<strong>Explanation:</strong> Same as Example 1, except with the <strong>5</strong> in the top left corner being modified to <strong>8</strong>. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
46+
</pre>
47+
48+
<p>&nbsp;</p>
49+
<p><strong>Constraints:</strong></p>
50+
51+
<ul>
52+
<li><code>board.length == 9</code></li>
53+
<li><code>board[i].length == 9</code></li>
54+
<li><code>board[i][j]</code> is a digit <code>1-9</code> or <code>'.'</code>.</li>
55+
</ul>
56+
</div>

0 commit comments

Comments
 (0)