832. Flipping an Image
Easy
Input: image = [[1,1,0],[1,0,1],[0,0,0]]
Output:
[[1,0,0],[0,1,0],[1,1,1]]
Explanation:
First reverse each row: [[0,1,1],[1,0,1],[0,0,0]].
Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]]Input: image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]
Output:
[[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
Explanation:
First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]].
Then invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]Last updated