Clear
This commit is contained in:
@@ -14,7 +14,7 @@ public class Solution
|
||||
HashSet<char> rowSet = new HashSet<char>();
|
||||
foreach (char c in row)
|
||||
{
|
||||
if(c != '.')
|
||||
if (c != '.')
|
||||
{
|
||||
int prevCount = rowSet.Count;
|
||||
rowSet.Add(c);
|
||||
@@ -28,10 +28,10 @@ public class Solution
|
||||
|
||||
private bool CheckColumns(char[][] board)
|
||||
{
|
||||
for(int columnIndex = 0; columnIndex < board[0].Length; columnIndex++)
|
||||
for (int columnIndex = 0; columnIndex < board[0].Length; columnIndex++)
|
||||
{
|
||||
HashSet<char> column = new HashSet<char>();
|
||||
for(int rowIndex = 0; rowIndex < board[columnIndex].Length; rowIndex++)
|
||||
for (int rowIndex = 0; rowIndex < board[columnIndex].Length; rowIndex++)
|
||||
{
|
||||
char ch = board[rowIndex][columnIndex];
|
||||
if (ch != '.')
|
||||
@@ -48,7 +48,7 @@ public class Solution
|
||||
|
||||
private bool CheckSubBoxes(char[][] board)
|
||||
{
|
||||
for(int i = 0; i < 27; i+=3)
|
||||
for (int i = 0; i < 27; i += 3)
|
||||
{
|
||||
int y = i / 9 * 3;
|
||||
int x = i % 9;
|
||||
@@ -61,12 +61,12 @@ public class Solution
|
||||
private bool CheckSubBox(char[][] board, int startY, int startX)
|
||||
{
|
||||
HashSet<char> set = new HashSet<char>();
|
||||
for (int y = startY; y < startY+3; y++)
|
||||
for (int y = startY; y < startY + 3; y++)
|
||||
{
|
||||
for(int x = startX; x < startX+3; x++)
|
||||
for (int x = startX; x < startX + 3; x++)
|
||||
{
|
||||
char ch = board[y][x];
|
||||
if(ch!='.')
|
||||
if (ch != '.')
|
||||
{
|
||||
int prev = set.Count;
|
||||
set.Add(ch);
|
||||
|
||||
Reference in New Issue
Block a user