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 INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY a as parameter.
*/
public static List reverseArray(List a){
// Write your code here
}
}
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
int arrCount = Integer.parseInt(bufferedReader.readLine().trim());
String[] arrTemp = bufferedReader.readLine().replaceAll("\\s+$","").split("");
List arr = new ArrayList<>();
for (int i =0; i < arrCount; i++){
int arrItem = Integer.parseInt(arrTemp[i]);
arr.add(arrItem);
}
List res = Result.reverseArray(arr);
for (int i =0; i < res.size(); i++){
bufferedWriter.write(String.valueOf(res.get(i)));
if (i != res.size()-1){
bufferedWriter.write("");
}
}
bufferedWriter.newLine();
bufferedReader.close();
bufferedWriter.close();
}
}*
* Complete the 'reverseArray' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY a as parameter.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!