-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoddmanout.java
More file actions
21 lines (20 loc) · 778 Bytes
/
oddmanout.java
File metadata and controls
21 lines (20 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.*;
import java.io.*;
public class oddmanout {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
Set<String> set = new HashSet();
int outerLoop = Integer.parseInt(br.readLine());
for (int x = 1; x < outerLoop + 1; ++x) {
int innerLoop = Integer.parseInt(br.readLine());
String[] nums = br.readLine().split(" ");
for (int y = 0; y < innerLoop; ++y) {
if (!set.add(nums[y])) set.remove(nums[y]);
}
pw.println("Case #" + x + ": " + set.toArray()[0]);
set.clear();
}
pw.flush();
}
}