Skip to content

Commit bf9c569

Browse files
committed
2248
1 parent 7387cb5 commit bf9c569

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Solution {
2+
public List<Integer> intersection(int[][] nums) {
3+
int[] counts = new int[1001];
4+
for(int[] list: nums){
5+
for(int n:list){
6+
counts[n]++;
7+
}
8+
}
9+
List<Integer> result = new ArrayList<>();
10+
final int L = nums.length;
11+
for(int i=1;i<counts.length;i++){
12+
if(counts[i] == L){
13+
result.add(i);
14+
}
15+
}
16+
return result;
17+
}
18+
}

0 commit comments

Comments
 (0)