Skip to content

Commit a7072f6

Browse files
committed
contains duplicate
1 parent 0fc7ec8 commit a7072f6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

contains-duplicate/se6816.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
Problem 217 : contains duplicate
3+
Summary : 주어진 배열에서 중복이 있으면 true, 없으면 false
4+
5+
*/
6+
7+
class Solution {
8+
public boolean containsDuplicate(int[] nums) {
9+
long count = Arrays.stream(nums)
10+
.distinct()
11+
.count();
12+
13+
return count != nums.length;
14+
}
15+
}

0 commit comments

Comments
 (0)