C++ 7MS Code O(N*K) Time Complexity
There is a two dimensional vector and it consists of a lot of subarrays. now we need to traverse the whole array using for loop and also we need to access each 
There is a two dimensional vector and it consists of a lot of subarrays. now we need to traverse the whole array using for loop and also we need to access each element of the subarrays. We have initialized the front =0 and end = image[i].size()-1, which means the size of each subarrays  that we need to traverse. \n\nThe question says that we need to flip the image. For flipping the image we need to reverse each element of the subarray and then changing the bits as 0 to 1 and 1 to 0.  The next i have used while loop to reverse each subarray by simply swapping it using 2 pointers. After doing this we have incremented the front part and decremented the end part.\n\nThe for loop that we have used in 7th line is helping us traverse through all array as whole. The first part of our question is finished.\nNow second part of our question says that we need to reverse the bits or change the bits as 0 to 1 and 1 to 0.For that we have used a second for loop which again is traversing through an array as whole the second for loop here is simply accessing the subarray. We have used not gate and simply returned the vector \n\n```\nclass Solution {\npublic\n    vector<vector<int>> flipAndInvertImage(vector<vector<int>>& image) {\n        int front =0;\n        int end = image[front].size()-1;\n        for(int i=0;i<image.size();i++){\n            front = 0;\n            end = image[i].size()-1;\n            while(front<=end){\n                swap(image[i][front],image[i][end]);\n                  front++;\n                   end--;\n               }\n            }\n         for(int i=0;i<image.size();i++){\n             for(int j = 0; j < image[i].size();j++){\n                 image[i][j]=!image[i][j];\n                 \n             }\n         }\n         \n        \n         return image;\n        }\n};\n```
[]