Java Solution 100% faster
\nclass Solution {\n    public int[][] flipAndInvertImage(int[][] image) {\n        \n        for(int i=0;i<image.length;i++){\n           reverse(image[i]);\n 
```\nclass Solution {\n    public int[][] flipAndInvertImage(int[][] image) {\n        \n        for(int i=0;i<image.length;i++){\n           reverse(image[i]);\n           invert(image[i]);\n        }\n   \n        // Either can use the for loop to invert the array individually or can use in single for loop\n        // for(int i=0;i<image.length;i++){\n        //    invert(image[i]);\n        // }\n        \n        return image;\n        \n    }\n    \n    static void reverse(int []image){\n        int s=0;\n        int e=image.length-1;\n        \n        while(s<e){\n            int temp=image[s];\n            image[s] = image[e];\n            image[e] = temp;\n            s++;\n            e--;\n        }\n    }\n    \n    static void invert(int []arr){\n           for(int i=0;i<arr.length;i++){\n               if(arr[i]==0){\n                   arr[i]=1;\n               }\n               else{\n                   arr[i]=0;\n               }\n           }\n    }\n}\n```
['Java']