JAVA 0 ms 100% faster
\nclass Solution {\n    public int[][] flipAndInvertImage(int[][] image) {\n       int i =0;\n        for(int [] mat : image){\n            mat = flip(mat);\n  
```\nclass Solution {\n    public int[][] flipAndInvertImage(int[][] image) {\n       int i =0;\n        for(int [] mat : image){\n            mat = flip(mat);\n            mat = invert(mat);\n            image[i++] = mat;\n        }\n        return image;\n    }\n\t//flipping \n    public int[] flip(int [] mat){\n        int i = 0;\n        int j = mat.length-1;\n        while(i < j){\n            int temp = mat[i];\n            mat[i++] = mat[j];\n            mat[j--] = temp;\n        }\n        \n        return mat;\n    }\n    //inverting\n    public int[] invert(int [] mat){\n       for(int i = 0; i < mat.length; i++){\n            if(mat[i] == 1){\n                mat[i] = 0;\n            }\n           else {\n               mat[i] = 1;\n           }\n        }\n        return mat;\n    }\n}\n```\n
['Java']