mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-11-09 22:08:58 +01:00
24 lines
549 B
Python
24 lines
549 B
Python
|
from typing import List
|
||
|
import sys
|
||
|
|
||
|
from Sudoku import Sudoku
|
||
|
from Grid import Grid
|
||
|
|
||
|
grid_values: List[List[int]] = []
|
||
|
for value in sys.stdin:
|
||
|
row_values = value.rstrip('\n').split(' ')
|
||
|
current_row: List[int] = []
|
||
|
for row_value in row_values:
|
||
|
current_row.append(int(row_value))
|
||
|
grid_values.append(current_row)
|
||
|
|
||
|
grid = Grid(grid_values)
|
||
|
sudoku = Sudoku(grid)
|
||
|
sudoku.solve()
|
||
|
|
||
|
for row in sudoku.grid.data:
|
||
|
column_string = ''
|
||
|
for column in row:
|
||
|
column_string += str(column) + ' '
|
||
|
print(column_string.strip())
|