At first it is look as similar is island, which is use DFS to solve, and truly the solution in leetcode is use this idea. But I think here we use BFS may be better, since it is like to check each neighbor, and also, oldcolor and newcolor may be the same, so we need to add a used 2-D array to check it.

Error:
N/A