You are viewing a single comment's thread. Return to all comments →
Scanner in =new Scanner(System.in); int n=in.nextInt(); int result=0; String s[]=new String[n]; for(int i=0; i
} for(char c='a'; c<='z';c++) { int count=0; for(int j=0; j<n;j++) { if(s[j].contains(Character.toString(c))) { count++; } else{ break; } } if(count==n) { result++; } } System.out.println(result); }
Seems like cookies are disabled on this browser, please enable them to open this website
Gemstones
You are viewing a single comment's thread. Return to all comments →
Scanner in =new Scanner(System.in); int n=in.nextInt(); int result=0; String s[]=new String[n]; for(int i=0; i