fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner input = new Scanner(System.in);
  10. String followers = input.nextLine().trim().replaceAll("\"","");
  11. HashSet<String> f1 = new HashSet<>();
  12. for(String s : followers.split(",")) f1.add(s);
  13.  
  14. String following = input.nextLine().trim().replaceAll("\"","");
  15. while(following.isEmpty()) following = input.nextLine().trim().replaceAll("\"","");
  16. System.out.println("People who dont follow you back:\n");
  17. for(String s : following.split(",")) {
  18. if(!f1.contains(s)) System.out.println(s);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.06s 4575232KB
stdin
name1,name2
name2,name3
stdout
People who dont follow you back:

name3