Invert an array

Report a typo

Define and implement a generic static method invert that returns the invert version of an input array.

You can invert an array in-place in the input array.

Sample Input 1:

Integer
10 6 2 3

Sample Output 1:

3 2 6 10
Write a program in Java 17
// do not remove imports
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;

class ArrayUtils {
// define invert method here
}
___

Create a free account to access the full topic