Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

function solve_sudoku(file_name) that finds the solution for the given sudoku. Input: a file name file name, where the file contains n lines, and each line

function solve_sudoku(file_name) that finds the solution for the given sudoku.

Input: a file name file name, where the file contains n lines, and each line contains n entries separated by commas. Each entry will either be a positive integer, or the letter 'x'.

Output: a nested list representing a completed sudoku grid. You may assume the file given will always contain exactly one valid solution.

File gridA.txt contains:

x,x,1,x

4,x,x,x

x,x,x,2

x,3,x,x

File gridB.txt contains:

1,x,9,x,x,x,x,6,x

8,4,x,x,1,x,x,7,5

x,x,2,x,x,3,x,x,4

x,x,8,3,2,1,x,4,7

x,x,5,x,x,x,6,x,x

4,2,x,6,9,5,8,x,x

7,x,x,1,x,x,4,x,x

6,9,x,x,8,x,x,5,3

x,5,x,x,x,x,7,x,9

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_2

Step: 3

blur-text-image_3

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago

Question

1. In taxonomy which are the factors to be studied ?

Answered: 1 week ago

Question

1.what is the significance of Taxonomy ?

Answered: 1 week ago