import java.util.*;

public class Verifier
{
    public static final String EXAMPLE_DATA = "example.txt";

    public Verifier (boolean debug)
    {
        _debug = debug;
    }

    public boolean verify ()
    {
        Vector<Category> cats = Util.loadCategories(EXAMPLE_DATA, _debug);
        Vector<Ticket> ticks = Util.loadTickets(EXAMPLE_DATA, _debug);
        Vector<Ticket> validTickets = Util.validTickets(cats, ticks);

        if (_debug)
        {
            for (int j = 0; j < validTickets.size(); j++)
                System.out.println(validTickets.elementAt(j));
        }

        HashMap<Integer, Category> results = new HashMap<Integer, Category>();

        for (int c = 0; c < validTickets.elementAt(0).values().length; c++)
        {
            int[] firsts = new int[ticks.size() -1];
            int key = 0;

            for (int i = 0; i < firsts.length; i++)
                firsts[i] = ticks.elementAt(i+1).values()[c];

            for (int k = 0; k < cats.size(); k++)
            {
                boolean valid = true;

                for (int l = 0; l < firsts.length; l++)
                {
                    if (cats.elementAt(k).valid(firsts[l]))
                    {
                        System.out.println("Category "+cats.elementAt(k)+" is valid for "+firsts[l]);
                    }
                    else
                    {
                        System.out.println("Category "+cats.elementAt(k)+" is invalid for "+firsts[l]);

                        valid = false;
                    }
                }

                if (valid)
                {
                    results.put(key, cats.elementAt(k));

                    key++;
                }
            }
        }

        for (int m = 0; m < results.size(); m++)
        {
            System.out.println("Element "+m+" maps to category "+results.get(m));
        }

        return false;
    }

    private boolean _debug;
}
@@ -595,33 +595,23 @@
         
-HashMap%3CInteger, 
+Vector%3C
 Category
@@ -630,25 +630,15 @@
 new 
-HashMap%3CInteger, 
+Vector%3C
 Cate
@@ -725,32 +725,67 @@
  c++)%0A        %7B%0A
+            System.out.println();%0A%0A
             int%5B
@@ -824,33 +824,8 @@
 -1%5D;
-%0A            int key = 0;
 %0A%0A  
@@ -1507,24 +1507,55 @@
 id = false;%0A
+                        break;%0A
             
@@ -1660,17 +1660,131 @@
 lts.
-put(key, 
+add(cats.elementAt(k));%0A%0A                    if (!results.contains(cats.elementAt(k)))%0A                        results.add(
 cats
@@ -1862,32 +1862,63 @@
    %7D%0A        %7D%0A%0A
+        System.out.println();%0A%0A
         for (int
@@ -2037,10 +2037,16 @@
 lts.
-g
 e
+lementA
 t(m)

Update Verifier.java