Write a function that receives a completed Sudoku board as parameter and returns either Finished
if the Sudoku is done correctly or Try again!
if not.
The board received an array of 9 subarrays as a parameter. These are the board's rows.
- There are 9 rows in a traditional Sudoku puzzle. There may not be any duplicate numbers in any row. Each row must be unique.
- The are 9 columns in a traditional Sudoku puzzle. There may not be any duplicate numbers in any column. Each column must be unique.
- A region is a 3x3 box. There are 9 regions in a traditional Sudoku puzzle. There may not be any duplicate numbers in any region. Each region must be unique.
- Every row, column and region contains the numbers one through nine only once.
doneOrNot([[5, 3, 4, 6, 7, 8, 9, 1, 2],
[6, 7, 2, 1, 9, 5, 3, 4, 8],
[1, 9, 8, 3, 4, 2, 5, 6, 7],
[8, 5, 9, 7, 6, 1, 4, 2, 3],
[4, 2, 6, 8, 5, 3, 7, 9, 1],
[7, 1, 3, 9, 2, 4, 8, 5, 6],
[9, 6, 1, 5, 3, 7, 2, 8, 4],
[2, 8, 7, 4, 1, 9, 6, 3, 5],
[3, 4, 5, 2, 8, 6, 1, 7, 9]]) // "Finished!"
doneOrNot([[5, 3, 4, 6, 7, 8, 9, 1, 2],
[6, 7, 2, 1, 9, 0, 3, 4, 9],
[1, 0, 0, 3, 4, 2, 5, 6, 0],
[8, 5, 9, 7, 6, 1, 0, 2, 0],
[4, 2, 6, 8, 5, 3, 7, 9, 1],
[7, 1, 3, 9, 2, 4, 8, 5, 6],
[9, 0, 1, 5, 3, 7, 2, 1, 4],
[2, 8, 7, 4, 1, 9, 6, 3, 5],
[3, 0, 0, 4, 8, 1, 1, 7, 9]]) // "Try again!"
export function doneOrNot( board ) {
//Insert your code here
}
https://www.hackerrank.com/contests/rohiniipx/challenges/subarray-7-1