Question: / * * Complete the 'reverseArray' function below. * * The function is expected to return an INTEGER _ ARRAY. * The function accepts INTEGER
Complete the 'reverseArray' function below.
The function is expected to return an INTEGERARRAY.
The function accepts INTEGERARRAY a as parameter.
public static List reverseArrayList a
Write your code here
public class Solution
public static void mainString args throws IOException
BufferedReader bufferedReader new BufferedReadernew InputStreamReaderSystemin;
BufferedWriter bufferedWriter new BufferedWriternew FileWriterSystemgetenvOUTPUTPATH";
int arrCount Integer.parseIntbufferedReaderreadLinetrim;
String arrTemp bufferedReader.readLinereplaceAlls$split;
List arr new ArrayList;
for int i ; i arrCount; i
int arrItem Integer.parseIntarrTempi;
arr.addarrItem;
List res Result.reverseArrayarr;
for int i ; i res.size; i
bufferedWriter.writeStringvalueOfresgeti;
if i res.size
bufferedWriter.write;
bufferedWriter.newLine;
bufferedReader.close;
bufferedWriter.close;
Complete the 'reverseArray' function below.
The function is expected to return an INTEGERARRAY.
The function accepts INTEGERARRAY a as parameter.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
