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));
        }

        int[] firsts = new int[ticks.size() -1];

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

        for (int k = 0; k < cats.size(); k++)
        {
            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]);
            }
        }

        return false;
    }

    private boolean _debug;
}
@@ -579,32 +579,202 @@
 j));%0A        %7D%0A%0A
+        HashMap%3CInteger, Category%3E results = new HashMap%3CInteger, Category%3E();%0A%0A        for (int c = 0; c %3C validTickets.elementAt(0).values().length; c++)%0A        %7B%0A    
         int%5B%5D fi
@@ -806,17 +806,46 @@
 () -1%5D;%0A
-%0A
+            int key = 0;%0A%0A    
         
@@ -896,16 +896,20 @@
         
+    
 firsts%5Bi
@@ -946,13 +946,17 @@
 s()%5B
-0
+c
 %5D;%0A%0A
+    
     
@@ -997,34 +997,81 @@
 ); k++)%0A        
+    
 %7B%0A
+                boolean valid = true;%0A%0A    
             for 
@@ -1110,32 +1110,36 @@
 ++)%0A            
+    
 %7B%0A              
@@ -1136,24 +1136,28 @@
             
+ 
+   
 if (cats.ele
@@ -1184,16 +1184,42 @@
 ts%5Bl%5D))%0A
+                    %7B%0A    
         
@@ -1328,13 +1328,65 @@
     
-else%0A
+    %7D%0A                    else%0A                    %7B%0A    
     
@@ -1481,29 +1481,410 @@
 ts%5Bl%5D);%0A
-            %7D
+%0A                        valid = false;%0A                    %7D%0A                %7D%0A%0A                if (valid)%0A                %7B%0A                    results.put(key, cats.elementAt(k));%0A%0A                    key++;%0A                %7D%0A            %7D%0A        %7D%0A%0A        for (int m = 0; m %3C results.size(); m++)%0A        %7B%0A            System.out.println(%22Element %22+m+%22 maps to category %22+results.get(m));
 %0A       

Update Verifier.java