You are given an m x n 2D image matrix where each integer represents a pixel. Flip it **in-place** along its horizontal axis.

**Example:**

Input image :

1 1

0 0

Modified to :

0 0

1 1

Input image :

1 1

0 0

Modified to :

0 0

1 1

Need a **hand?** Try out these hints, one at a time.

Remember that if you modify an input parameter that is of type Array in Java, you're actually modifying the object itself! That's why the return type is void.

Use nested for loops to traverse over the entire matrix. Remember this pattern for all 2D array problems :

`int rows = matrix.length`

and `int columns = matrix[0].length`

. Once you have the row / column dimensions, write 2 for loops that traverse the entire matrix. In the inner for loop, use a temporary variable to make the swap.
Here's the loop skeleton to help you out :

...

for(int i = 0; i <= r/2; i++){

for(int j = 0; j <= c; j++){

...

(swap)

...

}

}

public static void flipHorizontalAxis(int[][] matrix) { }

**C**

**Java**

**Python**