@@ -0,0 +1,1250 @@
+package com.hackerrank.contests.daysOfCode_30;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.Scanner;%0A%0Aclass Difference %7B%0A%09private int%5B%5D elements;%0A%09public int maximumDifference;%0A%0A%09public Difference(int%5B%5D a) %7B%0A%09%09// TODO Auto-generated constructor stub%0A%09%09this.elements = a;%0A%09%7D%0A%0A%09public void computeDifference() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%09List%3CInteger%3E differentList = new ArrayList%3CInteger%3E();%0A%09%09%0A%09%09for (int i = 0; i %3C elements.length - 1; i++) %7B%0A%09%09%09for (int j = i + 1; j %3C elements.length; j++) %7B%0A%09%09%09%09int temp = Math.abs(elements%5Bi%5D - elements%5Bj%5D);%0A%09%09%09%09differentList.add(temp);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09//System.out.println(differentList);%0A%09%09Collections.sort(differentList);%0A%09%09//System.out.println(differentList);%0A%09%09maximumDifference = differentList.get(differentList.size() - 1);%0A%09%7D%0A%0A%7D%0A%0Apublic class Day14_AllAboutScope %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%0A%09%09@SuppressWarnings(%22resource%22)%0A%09%09Scanner sc = new Scanner(System.in);%0A%09%09int N = sc.nextInt();%0A%09%09int%5B%5D a = new int%5BN%5D;%0A%09%09for (int i = 0; i %3C N; i++) %7B%0A%09%09%09a%5Bi%5D = sc.nextInt();%0A%09%09%7D%0A%0A%09%09Difference D = new Difference(a);%0A%0A%09%09D.computeDifference();%0A%0A%09%09System.out.print(D.maximumDifference);%0A%0A%09%7D%0A%0A%7D%0A

Create Day14_AllAboutScope.java