On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it. The state of the board is solved if and only if the …
使用两种语言实现,先贴C++的 class Solution { public: vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) { int row = image.size(); ].size(); int oldColor = image[sr][sc]; if (oldColor == newColor) { retu…