Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Created January 25, 2021 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/6d97242faaef677668a09a757642500e to your computer and use it in GitHub Desktop.
Save McLarenCollege/6d97242faaef677668a09a757642500e to your computer and use it in GitHub Desktop.

Validate Sudoku

Allowed Time: 70 minutes

Write a function DoneOrNot which returns 'Finished!' if passed a valid complete Sudoku board, otherwise return 'Try again!'

Sudoku rules: https://en.wikipedia.org/wiki/Sudoku

Examples

Input:

[[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]]

Output:

Finished!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment