Loading...
Loading...
Loading...
A picture is a grid of characters. Choose a cell and a new character. Replace that cell and every cell connected to it by shared sides that holds the same character as it. Print the picture afterwards.
Example
Input
3 3 aab aba bba 0 0 x
Output
xxb xba bba
Try the problem first. Open one hint at a time.
Remember the old character before you change anything.
If the new character equals the old one, print the picture unchanged.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor