C++ Solution | Using XOR
Code\n\nclass Solution {\npublic:\n    vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) {\n        for(int i=0;i<image.size();i++){\n         
# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) {\n        for(int i=0;i<image.size();i++){\n            reverse(image[i].begin(),image[i].end()); // reverse each row\n            for(int j=0; j<image[0].size(); j++){\n                image[i][j] = image[i][j] ^ 1;      // flip each number\n            }\n        }\n        return image;\n    }\n};\n```
['Bit Manipulation', 'C++']