Mines
You want to solve a version of the Minesweeper game.
You are given a m by n matrix where each element represents the number of mines around that field (on the 8 adjacent fields, and not including itself)
You have to output one valid configuration of the mines.
InputThe first line will contain two numbers M and N both less or equal than 100. The following M lines will contain N digits (0-8) representing the number of mines around that field
OutputTo the standard output write M lines of N characters each. representing the configuration (0 for empty fields and 1 for mines)
Input:
Output:
2 2
11
10Output:
00
01Input:
Output:
2 2
22
11Output:
00
11Note: a solution will always exist
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.