/** * Write a description of class LatinSquare here. * * @author (your name) * @version (a version number or a date) */ public class LatinSquare { // returns true iff n is in the xth row of a // e.g. inRow(4, {{3, 5}, {3, 6, 4}, {2}}, 1) = true, // e.g. inRow(4, {{3, 5}, {3, 6, 4}, {2}}, 2) = false public static boolean inRow(int n, int[][]a, int x) { // TODO return true; } // returns true iff n is in the xth column of a // e.g. inColumn(4, {{3, 5}, {3, 6, 4}, {2}}, 2) = true, // e.g. inColumn(4, {{3, 5}, {3, 6, 4}, {2}}, 1) = false public static boolean inColumn(int n, int[][]a, int x) { // TODO return true; } // returns true iff a is a Latin Square containing the numbers 1..n // a must be a square of side n, and every row and every column must be a permutation of 1..n // http://en.wikipedia.org/wiki/Latin_square public static boolean isLatin(int[][] a) { // TODO return true; } // CHALLENGE (optional): // returns true iff a is legal, complete Sudoku board // http://en.wikipedia.org/wiki/Sudoku public static boolean isSudoku(int[][] a) { // TODO return true; } }