using System.Collections.Generic;
private static bool HasDupes(char[] chars){
List<int> nums = new List<int>();
foreach(char c in chars){
if(nums.Count == 0) return false;
for(int i = 0; i<nums.Count-1; i++){
if(nums[i] == nums[i+1]) return true;
private static bool checkQ(int x, int y, char[,] board){
char[] chars = new char[9];
for(int i=x; i<x+3; i++){
for(int j = y; j<y+3; j++){
public static bool IsValidSudoku(char[,] board) {
char[] charLines = new char[9];
char[] charRows = new char[9];
charLines[j] = board[j,i];
charRows[j] = board[i,j];
if(checkQ((i/3*3), (i%3*3), board)) return false;
if(HasDupes(charLines) || HasDupes(charRows)) return false;
public static void Main()
Console.WriteLine("Hello World");