tiles[i][j] is 'B' for a black tile or 'W' for a white one.
You may repaint **at most one** tile. Return True if the floor can then contain a 2×2 block of tiles that are all the same colour, and False otherwise.tiles=[['W', 'B', 'W'], ['B', 'B', 'W'], ['W', 'W', 'B']] → True
Repainting the top-left tile to B makes the top-left 2×2 block entirely black.
tiles=[['W', 'B', 'W'], ['B', 'W', 'B'], ['W', 'B', 'W']] → False
Every 2×2 block has two tiles of each colour, so one repaint is never enough.
tiles=[['B', 'W', 'W'], ['B', 'W', 'W'], ['B', 'B', 'B']] → True
The top-right block is already all white, so no repaint is needed.
tiles=[['W', 'B', 'W'], ['B', 'B', 'W'], ['W', 'W', 'B']]
True
Run checks the first 3 tests in your browser. Submit checks all 13 tests on the server, hidden ones included.