int** flipAndInvertImage(int** A, int ASize, int* AColSize, int* returnSize, int** returnColumnSizes){ *returnSize=ASize; *returnColumnSizes=AColSize; for (int i=0; i<ASize; i++) { int left=0,right=*AColSize-1; while(left<=right){ int temp = !A[i][left]; A[i][left++] = !A[i][right]; A[i][right--] = temp; } } return A; }