Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class Friend
- {
- public static void main(String args[]) throws IOException
- {
- BufferedReader br=new BufferedReader(new InputStreamReader (System.in));
- int t=Integer.parseInt(br.readLine());
- for(int i=0; i<t;i++)
- {
- int n=Integer.parseInt(br.readLine());int f=t;
- int b[]=new int[n];
- String s[]=new String[n];
- String str=br.readLine();
- s=str.split(" ");
- for(int j=0;j<n;j++)
- {
- b[j]=Integer.parseInt(s[j]);
- for(int h=0; h<j;h++)
- {
- if(b[j]==b[h])
- f--;
- }
- }
- System.out.println(f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement