/**
* @param {number[][]} A
* @return {number[][]}
*/
var flipAndInvertImage = function(A) {
for(let row = 0; row < A.length; row ++){
A[row] = A[row].reverse()
for(let col = 0; col < A[row].length; col++){
A[row][col] = A[row][col] ? 0 : 1;
}
}
return A;
};