HackerRank Java Arrays- DS




https://www.hackerrank.com/challenges/arrays-ds/problem



  1. public class Solution {
  2. public static void main(String[] args) {
  3. /* Save input */
  4. Scanner scan = new Scanner(System.in);
  5. int size = scan.nextInt();
  6. int [] array = new int[size];
  7. for (int i = 0; i < size; i++) {
  8. array[i] = scan.nextInt();
  9. }
  10. scan.close();
  11. /* Print elements in reverse order */
  12. for (int i = size - 1; i >= 0; i--) {
  13. System.out.print(array[i] + " ");
  14. }
  15. }
  16. }
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]


donate a cup of tea :)


Join Our Facebook Group

Share this solution


download android app

Popular HackerRank Arrays-java Solutions








codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube