try this:
public int[] reverse3(int[] nums) {
int[] reversed = new int[nums.length];
for (int i=0; i<nums.length; i++) {
reversed[i] = nums[nums.length - 1 - i];
}
return reversed;
}
My input was:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
And the output I got:
12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1