@@ -0,0 +1,1042 @@
+import java.util.Scanner;%0Aclass GemStones%7B%0A    static int gemElementsCount(String s%5B%5D)%7B%0A        int c%5B%5D=new int%5B26%5D;%0A        for(int i=0;i%3C26;i++)%7B%0A            c%5Bi%5D=0;%0A        %7D%0A        for(int l=0;l%3Cs.length;l++)%7B%0A        char w%5B%5D=s%5Bl%5D.toCharArray();%0A        for(int i=0;i%3Cs%5Bl%5D.length();i++)%7B%0A            //System.out.println(w%5Bi%5D);%0A            if(w%5Bi%5D!=',')%0A            %7B%0A            int index=w%5Bi%5D-97;%0A            c%5Bindex%5D+=1;    %0A             s%5Bl%5D= s%5Bl%5D.replace(w%5Bi%5D,',');%0A             w=s%5Bl%5D.toCharArray();%0A             //System.out.println(s%5Bl%5D+ %22 index %22+ c%5Bindex%5D);%0A            %7D%0A        %7D%0A        %7D%0A        int count=0;%0A        for(int i=0;i%3C26;i++)%7B%0A            if (c%5Bi%5D==s.length)%7Bcount++;%7D%0A        %7D%0A    return count;%0A    %7D%0A    %0A    public static void main(String args%5B%5D)%7B%0A        Scanner s=new Scanner(System.in);%0A        int t=s.nextInt();%0A        s.nextLine();%0A        String%5B%5D str=new String%5Bt%5D;%0A        for(int i=0;i%3Ct;i++)%7B%0A            str%5Bi%5D=s.nextLine();%0A        %7D%0A        System.out.println(gemElementsCount(str));%0A    %7D%0A

Create GemStones.java