fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner x = new Scanner(System.in);
  13. Set<String> indexedContentSet = new HashSet<>();
  14. Set<String> set = new HashSet<>();
  15.  
  16. String tmp;
  17.  
  18. for (int i = 0;i < 12;i++) {
  19. tmp = x.nextLine();
  20. String arr[] = tmp.split("\\s+");
  21.  
  22. for (String y: arr) {
  23.  
  24. if (y.length() > 3) {
  25.  
  26. if (set.contains(y)) {
  27. indexedContentSet.add(y);
  28. }
  29.  
  30. set.add(y);
  31. }
  32. }
  33. }
  34.  
  35. System.out.println(indexedContentSet);
  36. System.out.println(set);
  37. }
  38. }
Success #stdin #stdout 0.14s 321344KB
stdin
Supervised and Unsupervised 
Learning
Agenda
Introduction
Supervised Learning
Unsupervised Learning
What is ML ?
Field of study that gives computers the 
ability to learn without being explicitly 
programmed
Uniformity of cell size
Uniformity of cell shape
stdout
[Learning, Unsupervised, Supervised, cell, Uniformity]
[study, explicitly, shape, learn, Unsupervised, Agenda, being, Supervised, cell, What, without, Learning, Field, that, size, Introduction, programmed, ability, gives, computers, Uniformity]