sets and maps deep copy would create copy of each of the sets shallow copy of list does not copy the sets within the list calling list on list will make shallow copy another group is formed for each column and those groups are appended to the list of groups finallya group is formed for each square and those groups are appended to the list of groups when all donethere is one groups list with groups in it when forming these groups it is critical that the same set appears in each of three groups this is because when row is reducedwe want the changes in that row to be reflected in the columns and squares where the elements of the row also appear solving sudoku puzzle means reducing the number of items in each set of group according to the two rules presented in sect writing function called reducegroup that is given list of sets to reduce can help the function reducegroup should return true if it was able to reduce the group and false if it was not given this reducegroup functionthe reduce function is as defined in sect the sudoku reduce function def reduce(matrix)changed true groups getgroups(matrix while changedchanged reducegroups(groupsthis algorithm is quite simpleand yet very powerful it is different than any other algorithms that have been presented so far in this text the concept is quite simplekeep reducing until no more reductions are possible we are guaranteed that it will terminate since each iteration of the algorithm reduces the number of items in some of the sets of the puzzle we never increase the size of any of these sets once we return from this function we may or may not have solution there are some puzzles that will not be solved by this sudoku solver because the two rules that are presented above are not powerful enough for all puzzles there are some situations where the number of items in set cannot be reduced by looking at just one group you would have to look at more than one group at the same time to figure out how to reduce the number of sets hold onyou don' need to figure out any more rules the next will present an algorithm for solving all sudoku puzzleseven the very hardest of them the rules presented in this will solve the sudoku puzzle given in this section and many others sudoku puzzles one through six on the text' website can be solved by this sudoku solver the reducegroups function above would presumably call reducegroup on each of the groups in its list and it would return true if any of the groups are reduced and false otherwise this copy belongs to 'acha