14091 - EE2310_Lab7_1   

Description

The objective of a Sudoku game is to fill a 9×9 array with digits (1-9) so that each column, each row, and each of the nine 3×3 subarrays contain all digits from 1 to 9 as in the figure below.

https://urbanrim.org.uk/images/sudoku-99.gif

Write a program that checks whether or not the user input is a Sudoku answer and outputs ‘yes’ or ‘no’.

Input

1 9 3 2 6 5 4 7 8

7 8 2 3 1 4 9 5 6

4 5 6 9 7 8 1 3 2

2 3 4 8 5 1 6 9 7

9 6 5 4 3 7 2 8 1

8 7 1 6 9 2 3 4 5

3 1 9 5 8 6 7 2 4

5 2 7 1 4 3 8 6 9

6 4 8 7 2 9 5 1 3

Output

yes

Sample Input  Download

Sample Output  Download

Tags




Discuss