vector<vector<int>> flipAndInvertImage(vector<vector<int>>& A) { vector<vector<int>> B; for (int i = 0; i < A.size(); i++) { vector<int> Row = A[i]; vector<int> Row2; for (int j = Row.size() - 1; j >= 0; j--) { int n = Row[j]; if (n == 0) { Row2.push_back(1); } else { Row2.push_back(0); } } B.push_back(Row2); } return B; }