@@ -0,0 +1,1278 @@
+import java.io.*;%0Aimport java.util.*;%0A%0Aclass RemoveDuplicates %7B%0A%09public static void main(String%5B%5D args) throws FileNotFoundException %7B%0A%09%09PrintStream output1 = new PrintStream(new File(%22RemovedFile.txt%22));%0A%09%09PrintStream output2 = new PrintStream(new File(%22BadContents.txt%22));%0A%09%09%0A%09%09Scanner scan = new Scanner(new File(%22Textbook.txt%22));%0A%09%09Map%3CString, Integer%3E counter = new HashMap%3CString, Integer%3E();%0A%09%09Set%3CString%3E memo = new HashSet%3CString%3E();%0A%09%09%0A%09%09while (scan.hasNextLine()) %7B%0A%09%09%09String course = scan.nextLine();%0A%09%09%09if (counter.containsKey(course)) %7B%0A%09%09%09%09counter.put(course, counter.get(course) + 1);%0A%09%09%09%7D else %7B%0A%09%09%09%09counter.put(course, 1);%0A%09%09%09%7D%0A%09%09%09String name = scan.nextLine();%0A%09%09%09String author = scan.nextLine();%0A%09%09%09String price = scan.nextLine();%0A%09%09%09%0A%09%09%09String group = course + name + author + price;%0A%09%09%09if (memo.add(group)) %7B%0A%09%09%09%09output1.println(course);%0A%09%09%09%09output1.println(name);%0A%09%09%09%09output1.println(author);%0A%09%09%09%09output1.println(price);%0A%09%09%09%7D else %7B%0A%09%09%09%09output2.println(course);%0A%09%09%09%09output2.println(name);%0A%09%09%09%09output2.println(author);%0A%09%09%09%09output2.println(price);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09%0A%09%09%7D%0A%09%09int max = 0;%0A%09%09%09%09%09for (String nameeee : counter.keySet()) %7B%0A%09%09%09%09%09%09if (counter.get(nameeee) %3E max) %7B%0A%09%09%09%09%09%09%09max = counter.get(nameeee);%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%09%0A%09%09%09%09%09System.out.println(max);%0A%09%7D%0A%7D

remove duplicates