import java.util.HashSet;
import java.util.Set;

/**
 * From the array of command-line arguments, identify the duplicates.
 * 
 * 
 * 
 * @author CSCI209 Class
 * 
 */
public class FindDuplicates2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	    
	    System.out.println("This program finds the duplicates in the command-line arguments.");
		
	    Set<String> nonDuplicates = new HashSet<>();
	    
	    for( String string : args ) {
            if( nonDuplicates.contains(string) ) {
                System.out.println("found duplicate " + string); 
            } else{
                nonDuplicates.add(string);   
            }
	    }
	}

}
