package com.bhavani.blogspot.misc; import java.util.Arrays; public class NaiveSudoku { public static int[][] grid = { { 0, 0, 0, 8, 0, 0, 0, 0, 9 }, { 0, 1, 9, 0, 0, 5, 8, 3, 0 }, { 0, 4, 3, 0, 1, 0, 0, 0, 7 }, { 4, 0, 0, 1, 5, 0, 0, 0, 3 }, { 0, 0, 2, 7, 0, 4, 0, 1, 0 }, { 0, 8, 0, 0, 9, 0, 6, 0, 0 }, { 0, 7, 0, 0, 0, 6, 3, 0, 0 }, { 0, 3, 0, 0, 7, 0, 0, 8, 0 }, { 9, 0, 4, 5, 0, 0, 0, 0, 1 } }; public static boolean canFitInRow(int[][] grid,int row, int col,int val) { for (int idx=0;idx