Google Interview Question

Write code to check the validity of a suduko square

Interview Answer

Anonymous

Jan 17, 2011

boolean checkSudoku(int[][] a, int n) { int s1, s2, s3; for(int i = 0; i 0) return false; s1 |= a[i][j]; s2 |= a[j][i]; s3 |= a[i%n][j%n]; } } return true; }