Reverse elements

Report a typo

In this task, you need to implement reverseElements method. It should reverse all rows of the twoDimArray as in the example below.

0 0 9 9              9 9 0 0
1 2 3 4 will become: 4 3 2 1
5 6 7 8              8 7 6 5

It is guaranteed that twoDimArray has at least 1 row.

P.S. You don't need to print anything in this task or create a new array: just modify the existing twoDimArray.

Write a program in Java 17
class ArrayOperations {
public static void reverseElements(int[][] twoDimArray) {
// write your code here

}
}
___

Create a free account to access the full topic