info@meritcampus.com    +91-85006-22255
...

Write a program to find the allowed numbers in the given 2x3 sudoku. The empty positions are marked as 0.

Input (int[][], SudokuPosition) Output (List)
`0 0 2 4 0 00 0 0 0 0 60 3 0 0 0 52 0 0 0 4 04 0 0 0 0 00 0 1 6 0 0SudokuPosition is [2, 4]` [1, 2, 3, 5]
`0 1 3 0 0 00 0 2 0 0 03 4 0 1 0 00 0 1 0 3 50 0 0 3 0 00 0 0 2 6 0SudokuPosition is [1, 5]` [2, 4, 5]

``` class FindAllowedNumbersIn2x3Sudoku {    public static void main(String s[])    {        int[][] sudoku = {{1, 0, 2, 4, 0, 0}, {0, 0, 0, 0, 0, 6}, {0, 3, 0, 0, 0, 5}, {2, 0, 0, 0, 4, 0}, {4, 0, 0, 0, 0, 0}, {0, 0, 1, 6, 0, 0}};        System.out.println("The numbers that can be placed at [5, 5] are : " + getAllowedNumbersAtGivenPosition(sudoku, new SudokuPosition(5, 5)));    } public static List<Integer> getAllowedNumbersAtGivenPosition(int[][] sudoku, SudokuPosition sudokuPosition) { //Write code here to find the allowed numbers in the given sudoku. } } class SudokuPosition { int rowPosition; int columnPosition; public SudokuPosition(int rowPosition, int columnPosition) { this.rowPosition = rowPosition; this.columnPosition = columnPosition; } public int getRowPosition() { return rowPosition; } public int getColumnPosition() { return columnPosition; } } ```

Topic: Java ArrayList

0
Wrong
Score more than 2 points