16x16 Sudoku
Time limit3sMemory limit128 MB
Solve a given 16x16 Sudoku puzzle so each row, column, and 4x4 box contains letters A to P exactly once, given a unique solution exists.
- Level
Medium6 of 10
- Topics
- Backtracking, Matrix, Implementation
- Solved
- No attempts yet
Problem
You are given a Sudoku board. Fill the board so that every row, every column, and each of the sixteen sub-grids contains each of the uppercase letters from A to P exactly once, with no repeats.
Given the initial state of such a puzzle, output the completed board. Every input is guaranteed to have exactly one solution.
In the original illustration, the left picture shows the initial state of the Sudoku and the right picture shows the solved state.
Input
The initial state of the puzzle is given as lines, each containing characters. Each character is either an uppercase letter from A to P (a filled cell) or - (an empty cell).
Output
Print the solved puzzle as lines of characters each.