Flip and Invert Matrix
You are given a two-dimensional integer matrix matrix containing 1s and 0s. For each row in matrix, reverse the row. Then, flip each value in the matrix such that any 1 becomes 0 and any 0 becomes 1.
Constraints
n, m ≤ 250wherenandmare the number of rows and columns inmatrix
https://binarysearch.com/problems/Flip-and-Invert-Matrix
Examples
Example 1
Input
- matrix =
[[1,1,0],
[0,0,1],
[0,0,0]]
Output
- answer =
[[1, 0, 0], [0, 1, 1], [1, 1, 1]]
Leave a comment