# Leetcode 832. Flipping an Image
```python=
class Solution:
def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:
xc, yc = len(image[0]), len(image)
for y in range(yc):
for x in range(xc):
image[y][x] = 1 - image[y][x]
image[y] = image[y][::-1]
return image
```