One pass with Go
\nfunc flipAndInvertImage(image [][]int) [][]int {\n    flip := func(a int) int {\n        if a == 0 {\n            return 1\n        }\n        \n        retur
```\nfunc flipAndInvertImage(image [][]int) [][]int {\n    flip := func(a int) int {\n        if a == 0 {\n            return 1\n        }\n        \n        return 0\n    }\n    \n    for row := 0; row < len(image); row++ {\n        l, r := 0, len(image[row])-1\n        \n        for l < r {\n            image[row][l], image[row][r] = flip(image[row][r]), flip(image[row][l])\n            l++\n            r--\n        }\n        \n        if l == r {\n            image[row][r] = flip(image[row][r])\n        }\n    }\n    \n    return image\n}\n```
['Go']