-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ03009.java
More file actions
31 lines (28 loc) · 872 Bytes
/
J03009.java
File metadata and controls
31 lines (28 loc) · 872 Bytes
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
31
import java.util.*;
public class J03009 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
sc.nextLine();
while (t-- >0) {
String s1 = sc.nextLine();
String s2 = sc.nextLine();
TreeSet<String> se1 = new TreeSet<>();
TreeSet<String> se2 = new TreeSet<>();
String[] a1 = s1.split("\\s+");
String[] a2 = s2.split("\\s+");
for (String x : a1) {
se1.add(x);
}
for (String x : a2) {
se2.add(x);
}
for (String x : se1) {
if (!se2.contains(x)) {
System.out.print(x + " ");
}
}
System.out.println("");
}
}
}