class Solution { public: vector<vector<char>> g; int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; // 上下左右向量 int solve(vector<vector<char>>& grid) { g = grid; int cnt = 0; // 遍历二维矩阵 for (int i = 0; i < g.size(); i ++ ) ...