-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashset.java
More file actions
34 lines (26 loc) · 827 Bytes
/
Copy pathHashset.java
File metadata and controls
34 lines (26 loc) · 827 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
32
33
34
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
String [] pair_left = new String[t];
String [] pair_right = new String[t];
for (int i = 0; i < t; i++) {
pair_left[i] = s.next();
pair_right[i] = s.next();
}
//Write your code here
HashSet<List<String>> uniquePair = new HashSet<>();
for(int i=0; i<t; i++){
List<String> list = new ArrayList<>();
list.add(pair_left[i]);
list.add(pair_right[i]);
uniquePair.add(list);
System.out.println(uniquePair.size());
}
}
}