import java.io.*;
import java.util.*;

public class Test1 {

    public static void main(String[] args) throws NumberFormatException, 
IOException {
        // TODO Auto-generated method stub
        BufferedReader inp=new BufferedReader(new 
InputStreamReader(System.in)); 
        int T=Integer.parseInt(inp.readLine()); 
        for(int k=0;k<T;k++)
        {           
            int duplicateWords=0;       
            int lines=Integer.parseInt(inp.readLine());
            String [] words=new String[lines];
            HashMap<String, Integer> FirstwordCount=new 
HashMap<String,Integer>();
            HashMap<String,Integer> SecondwordCount=new 
HashMap<String,Integer>();
            for(int i=0;i<lines;i++)
            {
                Boolean First=true;
                Boolean Second=true;
                words[i]=inp.readLine();            
                if(!FirstwordCount.containsKey(words[i].split(" ")[0]))
                {
                    FirstwordCount.put(words[i].split(" ")[0], 1);
                    First=false;
                }
                if(!SecondwordCount.containsKey(words[i].split(" ")[1]))
                {
                    SecondwordCount.put(words[i].split(" ")[1], 1);
                    Second=false;
                }
                if(First==true && Second==true)
                {
                    duplicateWords++;
                }               
            }
            System.out.println("Case #"+(k+1)+": "+duplicateWords);
        }       


    }


}

Can someone let me know in which scanrio i am failing .
https://code.google.com/codejam/contest/11254486/dashboard#s=p2&a=3 link to the 
question.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/6bb12b1f-fa6d-438f-94f2-4fe74095708f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to