Note: Your algorithm should flip the bits in place i.e. without using extra memory for the elements.
Example:
Input : 1 1 1 0 Output : 1 0 0 0
public static int[][] flipBits(int[][] grid) { }