Question: Please solve using Numpy: . check_sdk: (24 points) During lecture we worked on a partial Sudoku checker. For this problem you're to develop a full

Please solve using Numpy:

Please solve using Numpy: . check_sdk: (24 points) During lecture we workedon a partial Sudoku checker. For this problem you're to develop a

. check_sdk: (24 points) During lecture we worked on a partial Sudoku checker. For this problem you're to develop a full checker, handling rows, columns, and squares. check_adk takes one argument, a 9:9 array of integers that represents a Sudoku board and checks to see if each row, column, and 3x3 square (non-overlapping) contain each of the digits from 1-9. If that's true, check_adk prints "OK! " . If not, the errors are enumerated, again by printing. Here's a correct board: >>> print(bl) 3 4 6 N Un CO 9 1 N 9 9 8 4 HNUI W N LO +. 1 0 0- ONION 4 5 NAU I @ W I N U O >>> type (bl) >>> check_sdk (make_board (bl ) ) OK ! Here's a board with a single digit that's wrong: >>> print (b2) 5 3 4 6 HO I H NUI N U CO 9 2 7 9 un w 1 4 WNOIOI TWOIMANIA>>> type (b2) > >> check_sdk (make_board (b2) ) Bad row (S) : 7 Bad column (s) : 1 Bad square (s) : (7, 1) Notice that the errors report the row and column numbers, and the coordinates of the upper left-hand corner of squares, using one-based numbering, just like non-programmers do! Here's a board with several mistakes: >>> print(b3) 3 4 6 7 un CO 9 1 672 9 4 19 8 3 42 5 6 8 59 6 4 1 + N un 2 3 4 N N N HOW I >> > type(b3) >>> check_sdk (make_board(b3) ) Bad row (S) : 7 8 9 Bad column (s) : 4 5 6 7 Bad square (S) : (7, 4) (7, 7) Implementation notes: e The zip you download from D2L will include make_board . py, which has code for the make_board function. Copy the code for make_board into your a4 . py My check_adk function uses three helper functions: check_rows, check_squares, and check_19. check_squares is very much like the partial checker we worked on in class. check_19 is a boolean function that returns True iff an array contains exactly the integers from one through nine. I was about to write a check_cols function, too, but then I realized that check_rows could be called twice, once to check rows and then again to check columns. (Think about it!)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!