Answers for "Given an array, A, of integers, print N's elements in reverse order as a single line of space-separated numbers."

0

Given an array, A, of integers, print N's elements in reverse order as a single line of space-separated numbers.

static int[] reverseArray(int[] array) {
    int end = array.length-1;
    for(int i=end; i>=0; i--) {
        a[i] = a[i] + " ";
    }
    return String.valueOf(a);
}
Posted by: Guest on May-29-2021

Code answers related to "Given an array, A, of integers, print N's elements in reverse order as a single line of space-separated numbers."

Code answers related to "TypeScript"

Browse Popular Code Answers by Language