import java.util.*;

public class AdapterArray
{
    public static final String DATA_FILE = "data.txt";

    public static void main (String[] args)
    {
        boolean debug = false;
        boolean verify = false;

        for (int i = 0; i < args.length; i++)
        {
            if ("-help".equals(args[i]))
            {
                System.out.println("Usage: [-debug] [-verify] [-help]");
                System.exit(0);
            }

            if ("-debug".equals(args[i]))
                debug = true;

            if ("-verify".equals(args[i]))
                verify = true;
        }

        if (verify)
        {
            Verifier v = new Verifier(debug);

            if (v.verify())
                System.out.println("Verified ok.");
            else
                System.out.println("Verify failed!");

            System.exit(0);
        }

        Vector<JoltageAdapter> adapters = Util.loadData(DATA_FILE, debug);
        Device device = Util.largest(adapters, debug);
        Connector con = new Connector(debug);
        Vector<JoltageAdapter> sorted = con.connect(adapters);

        sorted.add(device.getAdapter());
        con.getDifferenceThree().add(device.getAdapter());
        
        int result = con.getDifferenceOne().size() * con.getDifferenceThree().size();

        System.out.println("Number of 1-jolt differences multiplied by the number of 3-jolt differences: "+result);
    }
}
@@ -1209,24 +1209,16 @@
 ter());%0A
-        
 %0A       
@@ -1222,83 +1222,44 @@
     
-int result = con.getDifferenceOne().size() * con.getDifferenceThree().size(
+long value = con.combinations(sorted
 );%0A%0A
@@ -1290,9 +1290,15 @@
 ln(%22
-N
+total n
 umbe
@@ -1306,83 +1306,54 @@
  of 
-1-jolt differences multiplied by the number of 3-jolt differences: %22+result
+distinct ways to arrange the adapters: %22+value
 );%0A 

Update AdapterArray.java