Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

o The starter code given below includes a complete main method that declares and creates a sample Sudoku solution as well as a modified (messed-up)

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
o The starter code given below includes a complete main method that declares and creates a sample Sudoku solution as well as a modified (messed-up) Soduko grid a The main method is just a test-driver that invokes the checksudokusolution method. checksudokusolution performs the high-level verification of the given Soduko solution. The complete Java code for the main and checksudokusolution methods is given below a Your assignment is to complete three of the following four methods which are invoked by checksudokusolution to perform the actual low-level verification checkvalues // each element is between 1 and 9 checkRow checkcolumn// each column has 9 distinct elements checksquare // each sub-grid has 9 distinct elements // each row has 9 distinct elements (given) o Hint: Coupon Collector Programming in Tava Arrays and ArrayLists Slide # 94 Sudoku Solution Verifier public class verifysudokusolution public static void main(String[] args) // Sudoku example from wikipedia int[]C] arr (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) // solution should have 3 x 3 subsquares containing no duplicates System.out.println(checksudokusolution(arr, 3)) // Swap a couple of values to mess something up, check it again int temp arr[2] 13]; arr [21 [3] arrS] [6]: arr[5] [6] temp; System.out.println(checkSudokuSolution(arr, 3))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions