@@ -0,0 +1,1244 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0A// This class has a method for finding the largest difference between two%0A// elements in an array of positive integers.  I did it in Java because%0A// hackerrank.com wouldn't let me do it in Ruby.%0Aclass Difference %7B%0A  %09private int%5B%5D elements;%0A  %09public int maximumDifference;%0A    public Difference(int%5B%5D array)%7B%0A        this.elements = array;%0A    %7D%0A%0A    void computeDifference()%7B%0A        int localMax = -1;%0A        int%5B%5D array = this.elements;%0A%0A        for(int i = 0; i %3C (array.length - 1); i++)%7B%0A%0A            for(int j = 1; (i + j) %3C array.length; j++ )%7B%0A                int diff = Math.abs(array%5Bi%5D - array%5Bj%5D);%0A                if(diff %3E localMax)%7B%0A                    localMax = diff;%0A                %7D%0A            %7D%0A        %7D%0A        maximumDifference = localMax;%0A    %7D%0A%7D%0A%0Apublic class Solution %7B%0A  %09public static void main(String%5B%5D args) %7B%0A    %09Scanner sc = new Scanner(System.in);%0A    %09int N = sc.nextInt();%0A    %09int%5B%5D a = new int%5BN%5D;%0A%0A    %09for (int i = 0; i %3C N; i++) %7B%0A    %09%09a%5Bi%5D = sc.nextInt();%0A    %09%7D%0A%0A      %09Difference D = new Difference(a);%0A%0A        D.computeDifference();%0A%0A        System.out.print(D.maximumDifference);%0A   %7D%0A%7D%0A

Add Scope.java