Added 26 solutions
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Author: Rodney Shaghoulian
|
||||
// Github: github.com/rshaghoulian
|
||||
// HackerRank: hackerrank.com/rshaghoulian
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Solution {
|
||||
public static void main(String[] args) {
|
||||
/* Read and save input */
|
||||
Scanner scan = new Scanner(System.in);
|
||||
int size = scan.nextInt();
|
||||
int [] array = new int[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
array[i] = scan.nextInt();
|
||||
}
|
||||
scan.close();
|
||||
|
||||
/* Print elements in reverse order */
|
||||
for (int i = size - 1; i >= 0; i--) {
|
||||
System.out.print(array[i] + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user