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

Function grid_values

data_structures/arrays/sudoku_solver.py:77–83  ·  view source on GitHub ↗

Convert grid into a dict of {square: char} with '0' or '.' for empties.

(grid)

Source from the content-addressed store, hash-verified

75
76
77def grid_values(grid):
78 """
79 Convert grid into a dict of {square: char} with '0' or '.' for empties.
80 """
81 chars = [c for c in grid if c in digits or c in "0."]
82 assert len(chars) == 81
83 return dict(zip(squares, chars))
84
85
86def assign(values, s, d):

Callers 2

parse_gridFunction · 0.85
time_solveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected