-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q7728.java
30 lines (25 loc) · 889 Bytes
/
Q7728.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package swexpert.d3;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Q7728 {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int[] arr = new int[10];
int tc = Integer.parseInt(br.readLine());
for(int z = 1; z <= tc; z++){
String n = br.readLine();
int len = n.length();
int result = 0;
for(int i = 0; i < len; i++){
int t = n.charAt(i)-'0';
if(arr[t]!=z){
result++;
arr[t] = z;
}
}
sb.append('#').append(z).append(' ').append(result).append('\n');
}
System.out.println(sb);
}// end of main
}// end of class