MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / solved

Function solved

data_structures/arrays/sudoku_solver.py:196–204  ·  view source on GitHub ↗

A puzzle is solved if each unit is a permutation of the digits 1 to 9.

(values)

Source from the content-addressed store, hash-verified

194
195
196def solved(values):
197 """
198 A puzzle is solved if each unit is a permutation of the digits 1 to 9.
199 """
200
201 def unitsolved(unit):
202 return {values[s] for s in unit} == set(digits)
203
204 return values is not False and all(unitsolved(unit) for unit in unitlist)
205
206
207def from_file(filename, sep="\n"):

Callers 1

time_solveFunction · 0.85

Calls 1

unitsolvedFunction · 0.85

Tested by

no test coverage detected