Shortest solution that beats 100% of users !!!
Intuition\n Describe your first thoughts on how to solve this problem. \nUsing bit operations.\n# Approach\n1. & is a reference to each elements, allowing us to
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUsing bit operations.\n# Approach\n1. & is a reference to each elements, allowing us to modify the real elements.\n2. Use reverse function to reverse the elements.\n3. Use XOR to flip the bits.\n# Complexity\n![image.png](https://assets.leetcode.com/users/images/5d5c7bf8-1857-4b31-9280-b1dcb76ee29b_1717221900.8321903.png)\n\n\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) {\n        for(auto& x : image) reverse(x.begin(), x.end());\n        for(auto& x : image){\n            for(auto& y : x) y ^= 1;\n        }\n        return image;\n    }\n};\n```
['C++']