Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5 dup-grid(grid) This function should duplicate a 2d array of integers. You may assume that it is 9x9 in size. It's important to make sure
5 dup-grid(grid) This function should duplicate a 2d array of integers. You may assume that it is 9x9 in size. It's important to make sure that the internal arrays you return are not aliases of the original data - they need to be new arrays! To check that, try out the following code snippet: orig - ... some grid ... copy = dup-grid(grid) copy[0][0] = 9 print (orig) print(copy) # should be different! 6 get_col(grid, x) This function takes a 9x9 grid. Don't make any assumptions about what sort of data it contains, but you can assume that it's arranged in the "array of columns" format. The x parameter is the column number; it will be in the range 0 through 8 (inclusive) Return all of the values in that column. Note that I don't care what order you return them, since I will be sorting your return values before I check them. 7 get_row(grid, y) This function is just like get_col(), except that this returns all of the values in a row. 8 get_square(grid, sx,xy) This function is just like get_col(), except that it returns the 9 values inside one of the squares of the grid. Remember, (0,0) is the upper-left square, and (2,0) is the upper-right
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started