Exception in thread "main" java.lang.NullPointerException
at java.lang.String.indexOf(String.java:1698)
at java.lang.String.indexOf(String.java:1678)
at Main.main(Main.java:13)
Scanner sc= new Scanner(System.in);
int n=sc.nextInt();
String ss[]=new String [n];
sc.nextLine();
for(int i=0;i<n;i++)ss[i]=sc.nextLine();//store test cases
String fs[]= longestS(ss[0], ss[1]);
for(int i=2;i<n;i++)
for(int j=0;j<fs.length;j++)
if(ss[i].indexOf(fs[j])==-1)fs[j]=null;
마지막줄이 13번째줄입니다