import java.util.*;

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

    public static final String FIRST = "row";
    public static final String SECOND = "class";
    public static final String THIRD = "seat";

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

        Vector<Category> results = Util.order(validTickets, cats);

       // if (_debug)
        {
            for (int i = 0; i < results.size(); i++)
                System.out.println("Category "+results.elementAt(i)+" maps to "+i);
        }

        
        if (FIRST.equals(results.elementAt(0).getType()) &&
            SECOND.equals(results.elementAt(1).getType()) &&
            THIRD.equals(results.elementAt(2).getType()))
        {
            return true;
        }

        return false;
    }

    private boolean _debug;
}
@@ -128,124 +128,34 @@
 nal 
-String FIRST = %22row%22;%0A    public static final String SECOND = %22class%22;%0A    public static final String THIRD = %22seat%22
+long EXAMPLE_RESULT = 1716
 ;%0A%0A 
@@ -652,31 +652,40 @@
     
-Vector%3CCategory
+HashMap%3CInteger, Integer
 %3E result
 s = 
@@ -680,17 +680,16 @@
 %3E result
-s
  = Util.
@@ -727,32 +727,52 @@
     
-// if (_debug)%0A        %7B
+ int fieldCount = 6;%0A        long value = 1;
 %0A   
@@ -768,36 +768,41 @@
 ue = 1;%0A        
+%0A   
     
+ 
 for (int i = 0; 
@@ -809,112 +809,55 @@
 i %3C 
-results.size(); i++)%0A                System.out.println(%22Category %22+results.elementAt(i)+%22 maps to %22+i);
+validTickets.elementAt(0).values().length; i++)
 %0A   
@@ -853,34 +853,33 @@
 h; i++)%0A        
-%7D%0A
+%7B
 %0A        %0A      
@@ -871,29 +871,24 @@
         
-%0A    
     if (
 FIRST.eq
@@ -883,147 +883,78 @@
 if (
-FIRST.equals(results.elementAt(0).getType()) &&%0A            SECOND.equals(results.elementAt(1).getType()) &&%0A            THIRD.equals(resul
+result.get(i) %3C fieldCount)%0A                value *= (long) validTicke
 ts.e
@@ -966,57 +966,35 @@
 tAt(
-2).getType()))%0A        %7B%0A            return true;
+0).values()%5Bi%5D;            
 %0A   
@@ -1020,13 +1020,33 @@
 urn 
-false
+(value == EXAMPLE_RESULT)
 ;%0A  

Update Verifier.java