You are viewing a single comment's thread. Return to all comments →
A little more thought required, but an interesting solution:
static int[] reverseArray(int[] a) { int[] solution = new int[a.length]; for(int i=a.length-1, j=0; i>-1; i--, j++) { solution[j] = a[i]; } return solution; }
Arrays - DS
You are viewing a single comment's thread. Return to all comments →
A little more thought required, but an interesting solution: