Two Pointer Solution
\n/**\n * @param {number[][]} image\n * @return {number[][]}\n */\nvar flipAndInvertImage = function(image) {\n    for(let i = 0; i < image.length; i++){\n     
```\n/**\n * @param {number[][]} image\n * @return {number[][]}\n */\nvar flipAndInvertImage = function(image) {\n    for(let i = 0; i < image.length; i++){\n        let left = 0;\n        let right = image[i].length-1;\n        while(left <= right){\n            if(left === right){\n                image[i][left] = image[i][left] === 0 ? 1 : 0\n            }else{\n                [image[i][left], image[i][right]] = [image[i][right], image[i][left]]\n                image[i][left] = image[i][left] === 0 ? 1 : 0\n                image[i][right] = image[i][right] === 0 ? 1 : 0\n            }\n            left++\n            right--\n        }\n    }\n    return image\n};\n```
['Two Pointers', 'JavaScript']